Count of non duplicate account numbers on a specific date

waaah21

New Member
Joined
Jan 15, 2015
Messages
6
My file has two tabs, Data and Counts.
I paste data from a different report onto the Data tab to get certain counts of different criterias.
The one I am stuck on is the following:
Need a formula to get a count of non duplicate account numbers on a specific date.

DateAccount
1/12/20153414169
1/12/20153414169
1/13/20159589558
1/13/20157510753
1/13/20159510901
1/13/20159510901
1/14/20154281860
1/14/20154222873

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>


With the sample data above if i needed the count for 1/13/2015 then the answer should be 3.

Thank you for the help.
 
Control+shift+enter, not just enter...

=SUM(IF(FREQUENCY(IF(account<>"",IF(date=$E2,MATCH(account,account,0))),ROW(account)-ROW(INDEX(account,1,1))+1),1))

where E2 houses a date of interest like 1/13/2015.
hello Aladin!
You are my teacher for ever....:) but now i don't understand why you did longer formula with the MATCH.... and ROW....as i Know the FREQUENCY function when Match number does not need to convert number in number( because they are already numbers).... if the "account" Range was texts would be good to convert in that way but in this case for the fact you have numbers you didn't need (MATCH....(ROW... inside the FREQUENCY see my formula #8
it gives you back the same outcome but shorter formula!
Thank you!
 
Last edited:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
hello Aladin!
You are my teacher for ever....:) but now i don't understand why you did longer formula with the MATCH.... and ROW....as i Know the FREQUENCY function when Match number does not need to convert number in number( because they are already numbers).... if the "account" Range was texts would be good to convert in that way but in this case for the fact you have numbers you didn't need (MATCH....(ROW... inside the FREQUENCY see my formula #8
it gives you back the same outcome but shorter formula!
Thank you!

If accounts are text numbers, a generic approach is needed. Otherwise, applying FREQUENCY function directly on numbers is the right thing to do.
 
Upvote 0
Are the dates in column W actual dates or are they text, also are account #'s numeric or text?
Where is the data coming from since you said it changes daily.
I have not been able to duplicate the issue, when I change the data type the formula returns a 0, but not an error. Usually a #VALUE would be something like dividing a number by a text.

Yes there was TEXT in the column.... I feel so frustrated sometimes when the issue is such a simple one and i can't get my head around it. Thanks you GUYS!
 
Upvote 0
Hi AhoyNYC,

Along the lines of this solution if there was a third condition for example. how would I go about adding to the formula?

If receive date is 30 days or older than Todays date on F1,
AND the SCHEDULED date is equivalent to 01/01/00,
How many non-duplicate account numbers are there?

In this example below it should be 2 unique account numbers.

ABCDEF
Receive DateScheduled DateAccount numberTodays Date01/21/15
12/01/14
01/01/00
789
12/01/1401/01/00789
12/01/1401/01/00905
12/01/141/26/15
6969
12/15/14
1/21/151234
1/20/1501/01/008484

<tbody>
</tbody>
 
Upvote 0
Here are a few different options.
F3 if you want to hard code the schedule date in the formula.
F6 if you want to enter the schedule date in a separate column.
F9 is an adjustment to Aladin's formula much is an array formula that must be entered with
Excel Workbook
ABCDEFG
1Receive DateScheduled DateAccount numberTodays Date1/21/2015
212/1/20141/1/2000789
312/1/20141/1/20007892
412/1/20141/1/2000905
512/1/20141/26/20156969Sch. Date1/1/2000
612/15/20141/21/201512342
71/20/20151/1/20008484
8Aladin'sFormula
92
10
CTRL-SHIFT-ENTER.
 
Upvote 0
@AhoyNC
FREQUENCY formula is faster then the SUMPRODUCT version. By the way, the latter is not complete: You also need a term like: --($C$2:$C$7<>"").
 
Upvote 0
Aladin,
Thanks for catching that.

Waaah21,
As Aladin stated the FREQUENCY formula will be faster than the formulas I gave you. Also, in case there are in blanks in your data the SUMPRODUCT formulas need to be changed to:

Code:
=SUMPRODUCT(--($A$2:$A$7<=$F$1-30),--($B$2:$B$7=DATEVALUE("1/1/2000")),1/COUNTIF($C$2:$C$7,C2:C7&""),[COLOR=#ff0000]--($C$2:$C$7<>""[/COLOR]))
or
=SUMPRODUCT(--($A$2:$A$7<=$F$1-30),--($B$2:$B$7=$F$5),1/COUNTIF($C$2:$C$7,$C$2:$C$7&""),[COLOR=#ff0000]--($C$2:$C$7<>"")[/COLOR])
 
Upvote 0

Forum statistics

Threads
1,216,759
Messages
6,132,556
Members
449,735
Latest member
Gary_M

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top