Count Unique Values if Max Date between criteria

KL28

New Member
Joined
Dec 18, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a table of data and need to count unique values in column A where the max date is between my criteria dates.

For example, here if my date criteria was >=01-May-22 AND <=31-May-22
then the formula will return 3 (Jack, Sarah, Jane)


If my date criteria was >=01-Jun-22 AND <=30-Jun-22 the formula will return 3 (Peter, Matt, Kelly)
1671362256142.png
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Welcome to the MrExcel board!

For the future, please consider the following:
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.

See if this is what you want.

22 12 18.xlsm
ABCDEF
1StartEndCount
2Sarah01-May-2201-May-2231-May-223
3Jane03-May-2201-Jun-2230-Jun-223
4Matt04-May-2201-Jul-2231-Jul-220
5Jack08-May-22
6Sarah12-May-22
7Kelly20-May-22
8Sarah25-May-22
9Peter26-May-22
10Jane28-May-22
11Peter05-Jun-22
12Matt11-Jun-22
13Kelly14-Jun-22
Count
Cell Formulas
RangeFormula
F2:F4F2=IFNA(ROWS(FILTER(A$2:A$13,(B$2:B$13=MAXIFS(B$2:B$13,A$2:A$13,A$2:A$13))*(B$2:B$13>=D2)*(B$2:B$13<=E2),NA())),0)
 
Upvote 0
Solution
Try this
Excel Formula:
=SUMPRODUCT((B2:B13>=DATE(2022,5,1))*(B2:B13<=EOMONTH(DATE(2022,5,1),0)))
Perhaps you missed this?
need to count unique values in column A where the max date is between my criteria dates.

if my date criteria was >=01-May-22 AND <=31-May-22
then the formula will return 3 (Jack, Sarah, Jane)
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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