Hi
I have a workbook (sample attached) that contains 2 worksheets (Data and Stats) with info re people selecting boxes.
In the Data worksheet I paste the collected data into columns D:G (columns A:C then calculate the month, day and time).
In the Stats worksheet I have 2 columns; column A which contains the Box Reference number and column B which contains the Box Name (box1, box2 etc).
I currently have a formula, in column C of the Stats worksheet, that calculates the number of times each box is selected as follows:
= COUNTIF(Data!$G$2:INDEX(Data!$G:$G,$R$2),$A2)
I have another formula, in column D of the Stats worksheet, that calculates the number of unique selections of a box by a single person ie if Box2 is selected by Person1 on more than one occasion then that is counted as 1 unique selection. Code as follows:
=SUM(IF(FREQUENCY(IF((Data!$G$2:INDEX(Data!$G:$G,Data!$R$2)=$A2),MATCH(Data!$F$2:INDEX(Data!$F:$F,Data!$R$2),Data!$F$2:INDEX(Data!$F:$F,Data!$R$2),0),""),IF((Data!$G$2:INDEX(Data!$G:$G,Data!$R$2)=$A2),MATCH(Data!$F$2:INDEX(Data!$F:$F,Data!$R$2),Data!$F$2:INDEX(Data!$F:$F,Data!$R$2),0),""))>0,1))
This all works perfectly, but I frequently have up to 30,000 rows in the Data worksheet and the calculation can take up to 30 minutes! What I would like to do is convert these formulas to a macro, which I assume will speed up the calculation time?
Any help would be appreciated....
Thanks
Bookmarks