How to exclude duplicates in a COUNTIFS formula

Aurora_S

New Member
Joined
Apr 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm trying to count number of intake dates within a month but sometimes there will be mulitple intakes in one day so I just want to count each date once.
The data is part of a bigger spreadsheet which I can't change and contains data from previous and subsequent months.

In the sample extract, there's a drop-down cell B1 which gives the month to be calculated (this reads as August but is in 'mmmm' date format of 01/08/22)
My base formula is =COUNTIFS($A:$A,">="&$B$1,$A:$A,"<="&EOMONTH($B$1,0)) but obviously this will counts duplicate dates in the list which need to be excluded.

Thanks
 

Attachments

  • Book1.JPG
    Book1.JPG
    94.2 KB · Views: 24

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
81,491
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about =ROWS(UNIQUE(FILTER(A5:A1000,MONTH(A5:A1000)=MONTH(B1))))
 
Upvote 0
Solution

Aurora_S

New Member
Joined
Apr 12, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about =ROWS(UNIQUE(FILTER(A5:A1000,MONTH(A5:A1000)=MONTH(B1))))
Fabulous - thanks so much!
Initially I tried to use A:A in the formula (as there are thousands) and it didn't work but altered it to a row range and it worked perfectly. I hadn't realised it would make such a difference.
 
Upvote 0

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
81,491
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,186,289
Messages
5,957,030
Members
438,284
Latest member
desklamp

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
Top