Countifs, Sum Product and Unique Entries

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
608
Office Version
  1. 365
Platform
  1. Windows
Hello,

The formula counts the number of occurrences if the IDs are Unique and falls between certain dates. I also want to include the sales person into the mix. In the below example, the results should be one since Bill has one unique ID that falls between the date range.

I tried adding the reference to the formula but could not get it to work.

Any help is appreciated.



Book1
ABCDEFG
1IDSales AssocDate4/1/174/30/17Bill
21471490339Bill4/11/17
31471490339Bill4/11/172
41471490339Bill4/11/17
51471731669Rick4/26/17
61471731669Rick4/26/17
71473630635Bill10/20/17
8
Sheet3
Cell Formulas
RangeFormula
F3{=SUMPRODUCT(IF((D2:D8<=F1)*(D2:D8>=E1), 1/COUNTIFS(D2:D8, "<="&F1, D2:D8, ">="&E1, B2:B8, B2:B8),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
A
B
C
D
E
F
1
ID
Sales Assoc
Date
4/1/2017
4/30/2017
Bill
2
1471490339
Bill
4/11/2017
3
1471490339
Bill
4/11/2017
1​
4
1471490339
Bill
4/11/2017
5
1471731669
Rick
4/26/2017
6
1471731669
Rick
4/26/2017
7
1473630635
Bill
10/20/2017

<tbody>
</tbody>

e3=SUM(IF(FREQUENCY(IF(C2:C7>=D1,IF(C2:C7<=E1,IF(B2:B7=F1,MATCH(B2:B7,B2:B7,0)))),ROW(B2:B7)-ROW(B2)+1),1))

control+shift+enter
 
Upvote 0
Hello,

Thanks for responding.

I made one change to your formula and it worked for me.

e3=SUM(IF(FREQUENCY(IF(C2:C7>=D1,IF(C2:C7<=E1,IF(B2:B7=F1,MATCH(A2:A7,A2:A7,0)))),ROW(B2:B7)-ROW(B2)+1),1))

control+shift+enter

Thanks again
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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