Sumproduct with UNIQUE records returned?

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
I have a sumproduct formula that draws on named ranges like this:

=sumproduct(
(createdate>=b1)*
(createdate<=b2)*
(email))

b1 is 1/1/14 and b2 is 1/31/14 so I'm asking for all records created in January.

But how do I ask for the count of DISTINCT email addresses? It's a pretty large data set ~ 200k records, fyi.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Just to add. I found the following formula on here but it's returning a #N/A error. I used CSE and see the curly braces around the formula:

SUM(IF(FREQUENCY(
IF(createdate>=B$1,
IF(createdate<=B$2,
IF(createdate<b$2,
MATCH(email,0))),ROW(email)-ROW(DataBase!$B$3)+1),1))

Database! tab is where the actual data of the ranges are.
There are no blank or nonsense or #N/A records in email or created date. Those ranges are also the exact same length.

Any ideas?</b$2,
 
Last edited:
Upvote 0
Try...

Code:
=SUM(IF(FREQUENCY(IF(createdate>=B$1,IF(createdate<=B$2,IF(email<>"",MATCH("~"&email,email&"",0)))),ROW(email)-MIN(ROW(email))+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0
@Domenic it's been running for the past 15 minutes - is that expected? I notice that the curly braces are not added yet, perhaps those get added once it's run?
 
Upvote 0
The frequency formula just finished running. Took about 45 minutes when left completely alone. Have you used this SQL*XL before? You recommend?
 
Upvote 0
The frequency formula just finished running. Took about 45 minutes when left completely alone. Have you used this SQL*XL before? You recommend?

I think SQL does such a count almost immediately. Could you run the recipe with a copy of your file and report back?
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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