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

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
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,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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