sumproduct with unique values

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
I'm using a formula, learned on this forum, to count only unique records within a sumproduct formula.

=SUMPRODUCT(($B$18:$B$741>=C4)*($B$18:$B$741<=C5)*(1/COUNTIF($D$18:$D$741,$D$18:$D$741)))

C4 and C5 are dates - I wish to include records within two date ranges. The data in column D are people - registration IDs.

I'd like to know the unique number of people within a date range.

By using the auto filter I know that I need to arrive at 124 people. Right now I get 67.06 so I know there must be a problem since I know that the number must be an integer.

Can anyone spot any issues with the formula or make any suggestions of what to check? I use the formula frequently and it normally works great.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try this array formula

=SUM(IF(FREQUENCY(IF($B$18:$B$741>=C4,IF($B$18:$B$741<=C5,MATCH($D$18:$D$741,$D$18:$D$741,0))),LIN($D$18:$D$741)-LIN($D$18)+1),1))

confirmed with Ctrl+Shift+Enter
(hold down both Ctrl and Shift keys and hit Enter)

M.
 
Upvote 0

Forum statistics

Threads
1,215,824
Messages
6,127,087
Members
449,358
Latest member
Snowinx

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