Applying a COUNTIF to a COUNTUNIQUEIFS using variable Date Ranges

41 views Asked by At

I have a sheet that can calculate the months and years using COUNTIFS, where I can select the year using a dropdown. However, I am looking to apply the same method to count UNIQUE names (Column B) within the same month and year I ave selected (Column A), maintaining the same dropdown method.

Here is the spreadsheet. Is this possible? Thank you!

+ A B C D E F G H I
1 Select Year 2023 January February March April May June
2       1 2 3 4 5 6
3     formula→ 2 3 2 1 0 1
4                  
5                  
6                  
7                  
8                  
9                  
10                  
11 Date Name              
12 1-Jan-2023 Burger King              
13 7-Jun-2022 Sonic              
14 1-Jan-2023 Burger King              
15 4-Feb-2023 McDonalds              
16 6-Feb-2023 McDonalds              
17 13-Feb-2023 Dairy Queen              
18 3-Mar-2023 Wendy's              
19 23-Mar-2023 McDonalds              
20 3-Apr-2023 Dairy Queen              
21 3-Jun-2023 Sonic              
22 3-Mar-2024 Wendy's              
23 23-Mar-2024 McDonalds              
1

There are 1 answers

2
rockinfreakshow On

You may try:

=map(D1:I1,lambda(x,index(countuniqueifs(B12:B,eomonth(A12:A,),eomonth(date(B1,month(x),1),)))))

enter image description here