Functions-data Recorded For Every Day For Some Subjects

Jan 9, 2006

I have some data recorded for every day for some subjects.

And the possible recorded value on each day is: 0 or 1 or 2 or 3 or 4 or null.

I have this type of data for number of subjects over many months.

My data looks like below.

Subjectnameyearmonth day1day2…………..day30day31

Name1990January 2044
Name1990February 31nullnull
Name1990March 2null31
So on.

I need to calculate the following 3 for each row.
1) On which day of the month first occurrence of the 4 comes?

This one I figured out using match() function which I paste below.
=MATCH(4,N2:AR2,0).

2) On which day of the month last occurrence of the 4 comes?
My data can not be sorted, and I couldn’t use match function here.

3) If there are any 4’s in a month, how many consecutive 4’s are there?

View 14 Replies


ADVERTISEMENT

Analyzing Scores Per Subjects

May 2, 2014

I need a formula to analyze the attached sheet.

I need to know
1-Number of students that passed with 70% and above in English, Maths and Biology
2- Number of students that passed with 50%-69% and above in English, Maths and Biology
3- Number of students that scored below 50% in English, Maths and Biology
4-Number of student that where absent for each of the subjects (English, Maths, biology)

Note: Total of all the columns per subject must be equal to the total number of students in the sheet.

View 4 Replies View Related

Capturing Lowest Value Recorded In Data That Changes?

Jan 3, 2012

I run a golf handicapping system that utilises excel quite heavily to record a LOT data over the course of a season. In essence we have in excess of 50 players who play once or twice a week and I record their Stableford scores (dont worry that's a golfing phrase but it is basically how they performed that day) and adjust their golf handicap accordingly - all in XL.

So - a player may start the season with handicap of 20 but over the season this will vary up and down as each score is recorded. A player may well play in excess of 50 rounds in a season.

I currently record the player's starting handicap in one column and in the next column appears the freshly calculated new handicap after a new score has been entered. The column containing the new handicap overwrites the old handicap value each time it is recalculated.

All I want to do is to create a 3rd column that records the lowest handicap value attained during the season. So for each player I guess it should take the newly calculated handicap and decide if it is lowest it has 'seen' in that column and if it is record it.

View 9 Replies View Related

Disable Command Button Once Data Is Recorded

Aug 7, 2008

I am making a timesheet which has a UserForm with textbox and 3 command buttons namely Search, IN and OUT. The program works like this, user type his id no., then clicks on search, once id match command buttons for IN and OUT are enabled. User clicks on IN button then current time which tags as NOW() will be pasted on the worksheet. Same goes with the OUT button. I was able to make them work that way. The problem here now is, the data being entered are vulnerable for data-re entry. What I mean is, if a certain user has already a recorded IN time, if he clicks on the IN time again, the data will be overwritten. Is there a way that once the user has already a recorded IN time, the IN button will be disabled for that user since he has already a recorded IN data?

View 14 Replies View Related

Data Sequence - Order Recorded Date

Dec 16, 2013

Find below the data sequence. 1st is the customer code, next are the date we have recd. the orders. In one excel command i want to find out the when was the order recd. date.

Code
17.11.2013
18.11.2013
19.11.2013
20.11.2013

11310
178
1235
1235
176

[Code] ......

If I give code and order qty then the formula should go to the code row and find out if any order of that qty had come if yes then date has to be returned as a result.

View 9 Replies View Related

Macro Recorded To Extract Data From Mainframe System?

Oct 12, 2012

I have following macro recorded to extract data from a mainframe system

open "C:DesktopReportRBDRBD.txt" for OUTPUT as #1
rc% = ps.sendstring("{clear}")
rc% = ps.sendstring("a24octdelbom*9w{enter}")
test1 = PS.getdata(450,3,27)
print #1,test1

The requirement here is run the above macro for the next 30 days automatically, for example

rc% = ps.sendstring("{clear}")
rc% = ps.sendstring("a25octdelbom*9w{enter}")
test1 = PS.getdata(450,3,27)
print #1,test1

and so on till 23 Nov. From the start date the macro should run for the next 30 days. Currently i am changing the dates manually in the macro

View 7 Replies View Related

Functions- Spreadsheet That Contains Data

Jun 11, 2008

I have a MS Excel spreadsheet that contains data as such:

A1 - 01T2001
A2 - 02T7001
A3 - 01T2001
A4 - 99T1001
A5 - 99T1001
A6 - 02T7001
A7 - 93T0120
.
.
.
A9999999 - 02T7001
A1000000 - 93T0120

There are duplicates in the data. Excel functions to identify the duplicates. I received a VB code from a friend but there are over 1 million rows on my spreadsheet, and it took more than a day but the scribe is still running. I want to try using a COUNTIF or FIND function to see if it couldspeed upthe process.

The code I receive from the friend is

Option Explicit

Public Sub Main()

Range("A1").Select
Dim strColumn As String
strColumn = InputBox("Please enter the column that contains the duplicates.", , "A")
If strColumn = "" Then Exit Sub

Range(strColumn & "1").Select
ActiveCell.Sort Key1:=Range(strColumn & "1"), Order1:=xlAscending
Do
If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
Rows(ActiveCell.Row).Delete Shift:=xlUp
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell.Value = ""
Range(strColumn & "1").Select
End Sub

View 9 Replies View Related

Clean Up Recorded Macro?

Jun 1, 2014

I want to clean up this recorded macro but not sure how, it highlights duplicate values in a column

[Code].....

View 3 Replies View Related

Shortening Recorded Macro?

Jul 15, 2012

shortening the below recorded macro?

Code:
Sub Macro1()
'
' Macro1 Macro

[Code].....

View 3 Replies View Related

Data, Performing Functions, And Percentages?

Mar 13, 2009

I have a very large grid of data, about 400Rx200C, which contains a lot of blank fields. All of this data is currently in values from 0-100 representing percentages, but not formatted as such. I need to make all of these values into Excel Percentages so naturally used Paste Special and Divide from a field with the value 100 in it and then simply format the cells as %.

However, this fills in all of the original empty cells with a 0.000% which I do not want, I need them to stay blank. And some of the cells that do have values also have 0.000% so I cannot just delete all of these values with a VBA script. I had been hoping the Skip Blanks option would do this, but it does not unfortunately.

View 3 Replies View Related

Lookup Functions & Data Arrangement

Apr 21, 2006

I'm at an impass and need some help please. I'm trying to create a spreadsheet that will look up UNSORTED data in Column A and return the value of the corresponding Row data in the adjacent column. Can this be done? It is my understanding that LOOKUP functions only work with sorted, ascending data, but this is not possible with the data I'm trying to analyze.

(eg. COLUMN A - contains unsorted list of names
COLUMN B - contains numbers indicating skill level of the person in the next column

I need the formula to look at column A, pick out "Joe Smith" and return the number value from COLUMN B)

View 3 Replies View Related

Eliminating Clutter In Recorded Macro

Oct 26, 2011

I have recorded the following macro and made few changes to it with my little VBA knowledge. But the code still looks very messy.

Code:
Application.ScreenUpdating = False
Sheets("Sheet2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;E:MacrosBSE Indices.iqy", Destination:=Range("A1"))
.Name = "BSE Indices"
.FieldNames = True

[Code] ..........

View 9 Replies View Related

Recorded Sorting Defines Set Range

Jul 14, 2006

I've noticed (a bit to late) that if you record with macro recorder a sorting statement that a range is captured. Because my files do vary in recordcounts, how can I sort indepently on the number of records.

View 4 Replies View Related

Build Undo In Recorded Macro

Oct 2, 2006

I have recorded certain macros. But after executing macro 'Undo' do not work. How can I do it ?

View 3 Replies View Related

Show Data Table - Functions Not Enabled

Mar 27, 2014

When I select anything under the Data Table drop down nothing happens. It is like none of the functions are enabled?

Data Table Picture.png

View 2 Replies View Related

Excel Count Functions Without Deleting Old Data

May 11, 2014

I have the following data. i need to count 5 times "N-TRX1" IN column "D". and returns me input "true/false". but the catch is that i need then to overlook this 5 times and start to count again from the same column without deleting the old data. Can i do it?

A
B
C
D
E

date
STATION
NO
NO+STATION

11/05/2014
N-TRX
1
1N-TRX

[Code] .........

View 4 Replies View Related

Recorded Macro Missing Paste Commands

Nov 13, 2008

I have been using the "record macro feature". What I want the macro to do is as follows.
1. cut all data from column C and paste it into G.
2. Use the textTocolumns feature to split a comma delimited string into 2 seperate columns.
3. user the textToColumns feature to remove any leading spaces from column G.
4. cut columns d-H and shift them left startign in column C.

I can do all of this find bu using the GUI while recording the macro but when I check the vb script it's completely missing the paste commands.

When I try and run the macro it, quite rightly, returns "run-time error '1004':No data was selected to parse.

Below is the resulting recorded macro.

How do I amend this macro do include pasting the cut data?

View 2 Replies View Related

Inserting A Muliple IF Statement In My Recorded Macro

Sep 21, 2009

I recorded a macro (which worked), then tried to get more out of it by adding code to add a further function (which didn't work). The code is as follows:-

View 3 Replies View Related

Loop Or Repeat Recorded Sort Macro?

Aug 10, 2011

I have a workbook where I need to sort data with range (K2:L24), then move down 208 rows and sort range (K210:L232) and repeat this upto 1000 times. I have shortened a recorded macro as an example and would like to know how to loop or repeat.

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 6/04/2011 by Greg

[Code].....

View 4 Replies View Related

Recorded Macro - Apply On Pivot Table

Dec 8, 2011

Below is a recorded macro i am trying to apply on a pivot table.

Code:

Range("F4:H4").Select
Range("H4").Activate
Selection.AutoFilter
ActiveSheet.Range("$G$4:$G$100000").AutoFilter Field:=1, Criteria1:="21", Operator:=xlTop10Items

The problem i am facing is that when i am trying to run it is not working.

View 9 Replies View Related

Recorded Macro Incorrectly Hiding Columns

Nov 18, 2013

I've recorded a macro in which I unhide certain columns, copy and paste some information then hide those columns again. The problem is that when the macro is finished, it incorrectly hides columns K to AN. I did not record that and it's not in the code so I'm lost as to why it's happening.

The macro is as follows :

Code:

Sub COPY()
'
' COPY Macro
'
'
Application.ScreenUpdating = False
Columns("K:BT").Select
Selection.EntireColumn.Hidden = False
Range("M5:N24").Select
Selection.COPY

[Code]...

Why it's hiding everything from K to AN. I've tried recording the macro several times but it's just not working, no matter the order in which I hide columns when recording it.

View 5 Replies View Related

Worksheet Function Too Long To Be Recorded In Macro

May 11, 2009

I have a list of items in Sheet1 column A (starting from row 1).

I would like the corresponding column B to have certain values depending on the value in column A (same row), as follows:

If the value in column A has "SYS????CZ", column B should be "HPC"
If the value in column A has "SYSNIS", column B should be "NIS"
If the value in column A has "SYSJBE", column B should be "JBE"
If the value in column A has "ICG????", column B should be "HPC"
If the value in column A has "IL????", column B should be "RUP"
If the value in column A has "SYSHPC08", column B should be "HPC"

What I tried was to record a macro while typing the formula in B1: ...

View 9 Replies View Related

Speed-Up/Optimize Recorded Macro Code

Aug 30, 2006

Im setting up a spreadsheet that does engineering calculations. Im using macros to run sizes from a standard schedule. It basically takes the values from one sheet (schedule) to another (calculation), then the result from the calculation sheet (Value only, not the link) is pasted back into the schedule. The macro seems very bulky and im sure that it can be made more efficient with a loop. here is a sample of the code from the macro;

Sheets("Calc sheet").Select
Range("C6").Select
ActiveCell.FormulaR1C1 = "=Schedule!R[1]C"
Range("C7").Select
ActiveCell.FormulaR1C1 = "=Schedule!RC[1]"
Range("C8").Select
ActiveCell.FormulaR1C1 = "=Schedule!R[-1]C[2]"
Range("C9").Select
Sheets("Schedule").Select
Range("G7").Select..................

View 3 Replies View Related

Recorded Macro Not Including All Rows. 2007

May 30, 2008

I manually create a pivot table (and record my actions) the pivot table references all of the information in my data range (70k+ lines). When I run the recorded macro the new pivot table limits the data range to the first 65536 lines (the old limit)....

View 6 Replies View Related

Today Or Now Functions In Queries To External Data Sources?

Dec 2, 2009

Is it possible to use a today or now function in an sql query to an external datasource in excel 2007? I have an excel 2007 spreadsheet, that I have linked to our financial database (MySql) using the database wizard. I can get the tables to display in excel no problem. One table shows how much staff have billed in each invoice period. I would like to create a query in excel, so that when this table displays in excel it shows how much each staff member has billed for the current invoice period, as opposed to all of them.

We weren't sure how to do this, so we decided to do a query to pull out the current invoice period, then we could combine this pivot table with the one for the amount billed table to give a table showing the amount each staff member has billed in the current invoice period (do this bit in excel).

The problem is we can't seem to make the query to pull out the current invoice period work. We have tried the query below, and all the variations of it that we can think of

SELECT invoice_period FROM tbl_invoice_periods WHERE STR_TO_DATE('" & NOW() & "', '%d/%m/%Y') BETWEEN start_date AND end_date;

We have also tried referencing a cell which shows the current date, but we cannot get this to work either (we may have made a mistake in the query here, we are not entirely sure how to reference an individual cell). The only way we have been able to get it to work is if you enter the current date directly into the query, but obviously this means it's no longer automated, which isn't a solution.

View 3 Replies View Related

Functions On Imported Data That Can Change Location In Table

Feb 7, 2007

I am trying to achieve can not be based on a range of rows or cells it must as this data is imported from a forecasting application and the location of the targets may change.

Perhaps an offset to the current selection can be used some how, but have a look-see if you know where Im coming from.

'I have used this to find a target in a data range.

Dim r1 As range

Public Sub FindDataIn Range(r As Range, target As Variant)

Set r1 = r.Find(target)
If r1 Is Nothing then
Msg Box target & " was not found"
Else
r1.Select
End If
End Sub

'Then I inserted and Named this procedure to find the data on various assumptions or targets - SUCH AS THE VALUE "14306".

FindDataInRange ActiveSheet.Range (A1:A226), "14306"
Selection.EntireRow.Select
Selection.Copy
Selection.Insert Shift:=x1Down
Selection.EntireRow.ClearContents

Then I write this again for another Target such as 14307 and it repeats

The result is that it finds the target cell I get an empty row above the two rows that contain that target. (LET ME EXPLAIN WHAT I MEAN BY TWO ROWS)

The thing is there are two rows containing 14306 in that range and the range is sorted ascending so that they are positioned one under the other. Each row has different forecast totals beside this number because one is an export SKU and one is a Domestic.

What I want to do is combine the two rows as one with one row of forecast totals for the number rather than two.

Like this:
14306big Widget Domestic 26 89 (This is combined as a new row)

Instead of this:
14306big Widget Export 12 14 (These 2 rows are then deleted)
14306big Widget Domestic 14 75

Also the Forecast totals run across 12 columns (one for each month) and then there is a column for year totals of each row that needs to remain the same.

Most important this here is this cannot be based on a range it must as this data is imported from a forecasting application and the location of the targets may change.

View 9 Replies View Related

Recorded Macro Doesn't Seem To Provide Expected Result

Sep 21, 2009

On column A, I simply do an A-Z sort that gives the expected result. So I recorded it as a macro. In column G is a code that corresponds with column A. When the marcro is executed Column A is sorted but the corresponding value in G stays where it is. Clicking the A-Z button works. But when that action is recorded as a macro I get the above quirck. Since VBA is not my beef, I don't really know what wrong.

View 4 Replies View Related

Converting Recorded Macro Into Workable VBA To Add New Sheet At End Of Workbook

Apr 22, 2013

I have a button with a macro assigned. The macro needs to create a new worksheet at the end of the workbook, rename the new sheet to "New County", make the cell size match the rest of the workbook, and then paste in a template from another sheet called "Master".

I recorded a macro that does this, but it has a static reference to the new sheet instead of what ever the new sheet is. So the Macro works one time, but never again. I'm sure this is an easy fix, and perhaps there is a much easier way to do this, but my limited VBA knowledge is hampering me.

Code:

Sub AddNewCounty()
'
' AddNewCounty Macro
' Adds a new County sheet to the workbook.
'
'

[Code]...

View 9 Replies View Related

Excel 2010 :: Result Of Recorded Macro Is Different From Hand Work

Mar 10, 2014

I have csv file with tab delimited fields (see attached blacklist.csv). 3rd and 4th fields are in format dd/mm/yyyy hh24:mi:ss, some fields can be zero. I need to split data to columns and display datetime fields in format dd.mm.yyyy hh:mm:ss.

OK... open csv in Excel, select column A, press button "Split in columns", select tab as delimiter, choose date format (DMY) for 3rd and 4th field and press OK. Test is splitted into columns, now select columns C and D and select desired format "dd.mm.yyyy hh:mm:ss". Then I select columns A:E and set column widths to fit data in columns. This all is OK and without problems (see attached file Handmade.xlsx).

But now... Now I record all previous step into macro. There is macro text: [Code] ....

Now I copy macro text into clipboard and open blacklist.csv again. Insert button to list and bind it to new macro. Paste text of macro from clipboard. (See attached file blacklist_beforeClick.xlsm). Now click button Btn and voila... some dates remain in previous format, some dates seems to be in desired format, but day and month are swapped. Why are there differences when comparing data made by hand and data made by macro??? compare.jpg This is the same behavior in more computers, some use Czech version of Excel 2010, some use English version.

View 2 Replies View Related

Modify And Enhance Recorded Code - Delete Rows Based On Value

Aug 22, 2012

I searched many sites and used codes which delete Rows based on criteria. In my case those codes works, BUT it took so much time about 30 min since there is about 75 thsd rows, and that solution in not time saver. I recorded code below and it is done in seconds. make it dynamic, VBA, since number of rows is every month larger. Basicly, I need code which delete rows based on Column B, where walue is "R"

Code:
Sub DelRowsBasedOnOneCriteria()
'
' DelRowsBasedOnOneCriteria Macro

[Code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved