Counting unique values filtered by two other criteria

tb_OF21

New Member
Joined
Oct 1, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
On worksheet called 'Interventions', column A has a list of reference numbers. Column E is a date and column K is an attendance register.
On a second sheet called 'lists', A1 has a start date and A2 has an end date. On this same sheet, cell M57 shows the text 'attended/completed' as part of a list of options for dropdown on the previous sheet column K.
I want to be able to calculate the number of unique reference numbers in column A when the date in column E is equal to or between the start and end dates (2nd sheet A1 & A2) AND the attendance status matches cell Lists!M57.
I have loads of COUNTIFS formulas in this workbook but I can't figure out a way to count only the unique vales, including not counting blanks. Is this possible?
Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Assuming my sample data matches your request, try:

Book1
AEK
1ReferenceDateStatus
211/1/2022Attended
321/2/2022Attended
431/3/2022Attended
541/4/2022Completed
651/5/2022Attended
711/6/2022Completed
821/7/2022DNS
931/8/2022Attended
1041/9/2022Completed
1151/10/2022DNS
1211/11/2022Attended
1321/12/2022DNS
1431/13/2022Attended
1541/14/2022Completed
1651/15/2022Completed
1711/16/2022Completed
1821/17/2022Completed
1931/18/2022Attended
2041/19/2022DNS
2151/20/2022Completed
22
Interventions


Book1
AM
11/8/2022
21/15/2022
3
57Completed
58
59Unique count
602
Lists
Cell Formulas
RangeFormula
M60M60=IFERROR(ROWS(UNIQUE(FILTER(Interventions!$A$2:$A$30,(Interventions!$A$2:$A$30<>"")*(Interventions!$E$2:$E$30>=A1)*(Interventions!$E$2:$E$30<=A2)*(Interventions!$K$2:$K$30=M57)))),0)
 
Upvote 0
Solution
Assuming my sample data matches your request, try:

Book1
AEK
1ReferenceDateStatus
211/1/2022Attended
321/2/2022Attended
431/3/2022Attended
541/4/2022Completed
651/5/2022Attended
711/6/2022Completed
821/7/2022DNS
931/8/2022Attended
1041/9/2022Completed
1151/10/2022DNS
1211/11/2022Attended
1321/12/2022DNS
1431/13/2022Attended
1541/14/2022Completed
1651/15/2022Completed
1711/16/2022Completed
1821/17/2022Completed
1931/18/2022Attended
2041/19/2022DNS
2151/20/2022Completed
22
Interventions


Book1
AM
11/8/2022
21/15/2022
3
57Completed
58
59Unique count
602
Lists
Cell Formulas
RangeFormula
M60M60=IFERROR(ROWS(UNIQUE(FILTER(Interventions!$A$2:$A$30,(Interventions!$A$2:$A$30<>"")*(Interventions!$E$2:$E$30>=A1)*(Interventions!$E$2:$E$30<=A2)*(Interventions!$K$2:$K$30=M57)))),0)
You absolute genius thank you!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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