Count Row Skipping Duplicates in Date Range

jessebh2003

Board Regular
Joined
Feb 28, 2020
Messages
71
Office Version
  1. 365
Platform
  1. Windows
I have a dynamic spreadsheet that updates values based on the year selected in a drop down on worksheet Summary and my data is in Table13 on worksheet Data. I'm trying to figure out how to count the number of rows within the date but skip duplicates.

Summary.xlsx
CEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1Year2021
2Months123456789101112YTD
3Evaluations
4CountCountCountCountCountCountCountCountCountCountCountCountCount
5Total submissions0.00
Summary
Cell Formulas
RangeFormula
AC5AC5=SUM($E$5:$AB$5)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:AD5Cell Value=0textNO
Cells with Data Validation
CellAllowCriteria
E1List=Years


For instance, in the below table I would like to count rows 2-6 as 1 because the data in columns A-E are the same; count rows 7-14 as 1, etc. Where I'm running into issues is the counting but skipping duplicates. I have the date range part of the formula already. (The data is sorted to make viewing easier but the table has over 22,000 rows.)

Excel Formula:
,Table13[SubmissionDate],">="&DATE($E$1,$E$2,1),Table13[SubmissionDate],"<="&DATE($E$1,$E$2,31)

Summary.xlsx
ABCDE
1FormIDUserIDEventIDRecurrenceParentIDSubmissionDate
2163732853183901/29/2021 10:08
3163732853183901/29/2021 10:08
4163732853183901/29/2021 10:08
5163732853183901/29/2021 10:08
6163732853183901/29/2021 10:08
722133210717010/16/2021 11:04
822133210717010/16/2021 11:04
922133210717010/16/2021 11:04
1022133210717010/16/2021 11:04
1122133210717010/16/2021 11:04
1222133210717010/16/2021 11:04
1322133210717010/16/2021 11:04
1422133210717010/16/2021 11:04
151993321037603/16/2021 15:44
161993321037603/16/2021 15:44
172262321089107/26/2021 10:20
182262321089107/26/2021 10:20
192262321089107/26/2021 10:20
202262321089107/26/2021 10:20
Data


Hope that all makes sense. Appreciate any help, ideas or suggestions on how I can count rows, skipping duplicates within a date range. Thank you!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try this -
Excel Formula:
=Count(Unique(Table13[SubmissionDate])
Thanks. I added the missing close parenthesis at the end.

To add my date qualifiers to the formula and change to COUNTIFS, I get an error message, "You've entered too few argument for this formula." I need to be able to count the unique values given the date range where the year is in $E$1 and the month is in row 2 (Jan in E2, Feb in G2, Mar in I2, etc.).

Excel Formula:
=COUNTIFS(UNIQUE(Table13[SubmissionDate]),Table13[SubmissionDate],">="&DATE($E$1,$E$2,1),Table13[SubmissionDate],"<="&DATE($E$1,$E$2,31))

Also, in the unlikely event that two different users have a submission at the same time, would your solution count them as two unique values or one? Thanks.
 
Upvote 0
I get an error message, "You've entered too few argument for this formula."
Try this - It took me a while to get to this. Someone might help you shorten this Formula.

Excel Formula:
=Let(
Filter1,
Filter(UNIQUE(Table13[SubmissionDate]),UNIQUE(Table13[SubmissionDate])>=DATE($E$1,$E$2,1)),
Filter2,
FILTER(FILTER1,FILTER1<=DATE($E$1,$E$2,31)),
COUNT(FILTER2))

two different users have a submission at the same time
If the date and time shall match it will take as one. Problem will be when date is same but time differs
 
Upvote 0
Solution
Try this - It took me a while to get to this. Someone might help you shorten this Formula.

Excel Formula:
=Let(
Filter1,
Filter(UNIQUE(Table13[SubmissionDate]),UNIQUE(Table13[SubmissionDate])>=DATE($E$1,$E$2,1)),
Filter2,
FILTER(FILTER1,FILTER1<=DATE($E$1,$E$2,31)),
COUNT(FILTER2))


If the date and time shall match it will take as one. Problem will be when date is same but time differs

Thanks, @SanjayGMusafir, that worked perfectly!! Very much appreciated!!
 
Upvote 0
=Let( Filter1, Filter(UNIQUE(Table13[SubmissionDate]),UNIQUE(Table13[SubmissionDate])>=DATE($E$1,$E$2,1)), Filter2, FILTER(FILTER1,FILTER1<=DATE($E$1,$E$2,31)), COUNT(FILTER2))
@jessebh2003 If you may note, this formula is dependent on many input cells. Also it needs to be changed with every month to tell how many days the month has.

There can be more dynamic way of doing it.

If we can put a date in cell E1 rather than putting a year, underneath formula can calculate rest based on beginning and end of that month. This way it shall be dependent on only one cell.

Check this -

Excel Formula:
=Let(UDate,UNIQUE(Table13[SubmissionDate]),
Filter1,Filter(UDate,UDate>=EOMONTH($E$1,-1)+1),
Filter2,FILTER(FILTER1,FILTER1<=EOMONTH($E$1,0)),
COUNT(FILTER2))
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

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