unique/count/filter dates into days, months, and years.

Ev1lZer0

New Member
Joined
Sep 26, 2022
Messages
38
Office Version
  1. 365
Platform
  1. Windows
I feel like I was getting close to a solution, but just not quite getting there...

I am trying to count all the unique days, months, and years in column C and then get a total for each time they are used.

Here is my current spreadsheet, I have manually typed in my data where the formula should go so that you see what I'm trying to capture. this list will be an ever-growing list.

I also have a goal of creating a bar graph for each data point. One graph totaling all entries for each date, one graph totaling all entries for each month (with the appropriate year), and one graph totaling all entries for each year.

I have previously had luck with this formula, but this data is not counting and filtering text, it's filtering dates. =UNIQUE(FILTER(F2:F22525,LEFT(F2:F22525,6)="judge:"))

Inmates in Custody with Military Service (SERV) Flag Set.xlsx
ABCDEFGH
1Yakima County Department of Corrections
2Inmates in Custody with Military Service Flag Set
3
41/10/2023
5
6NameBooking DateUnique DaysCountUnique MonthsCountUnique YearsCount
7Gomez, Victor1/23/20201/23/20201Jan-20120201
8Mcginnis, Nathan Lee4/16/20214/16/20211Apr-21120212
9Pedroza-Lewis, Jonathan Juan9/1/20219/1/20211Sep-23120225
10Wertman, James Patrick4/25/20224/25/20221Apr-23120231
11Robinson, Neal Scott6/18/20226/18/20221Jun-221
12Corbray, Jacquita Louise8/23/20228/23/20221Aug-221
13Balzer, Daniel Eugene11/10/202211/10/20221Nov-222
14Brown, Maurice Terrell11/11/202211/11/20221Jan-231
15Tenney, Nickalas John1/7/20231/7/20232
16Glossip, Larry Bruce1/7/2023
17Total101010
Sheet1
Cell Formulas
RangeFormula
C7:C15C7=UNIQUE(B7:B16)
Dynamic array formulas.
 

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.
Okay, I've made some changes and found solutions for the day and year, but I can't find a solution for the month.

I know it doesn't seem it, but column E is displaying accurate information, but as soon as I format it into a date or use the Text function, it becomes incorrect. That is because the number in cell E2 (12020) is equivalent to the date 11/27/1932. however, 12020 with a space would read 1 2020 which is January 2020. Needless to say, I'm at a loss for how to make this work for finding the unique month with the accompanying year and getting a total entry count.

Master list.xlsx
ABCDEFGH
1Booking DateUnique DatesTotal entries of this dateUnique Month/YearsTotal entries of this month/yearYears
201/23/2001/23/20612020020206
301/23/2004/16/216420210202112
401/23/2009/01/216920210202232
501/23/2004/25/22642022020239
601/23/2006/18/226620220
701/23/2008/23/226820220
804/16/2111/10/2261120220
904/16/2111/17/2221220220
1004/16/2112/05/226120230
1104/16/2101/07/239
1204/16/21
1304/16/21
1409/01/21
1509/01/21
1609/01/21
1709/01/21
1809/01/21
1909/01/21
2004/25/22
2104/25/22
2204/25/22
2304/25/22
2404/25/22
2504/25/22
2606/18/22
2706/18/22
2806/18/22
2906/18/22
3006/18/22
3106/18/22
3208/23/22
3308/23/22
3408/23/22
3508/23/22
3608/23/22
3708/23/22
3811/10/22
3911/10/22
4011/10/22
4111/10/22
4211/10/22
4311/10/22
4411/17/22
4511/17/22
4612/05/22
4712/05/22
4812/05/22
4912/05/22
5012/05/22
5112/05/22
5201/07/23
5301/07/23
5401/07/23
5501/07/23
5601/07/23
5701/07/23
5801/07/23
5901/07/23
6001/07/23
Sheet1
Cell Formulas
RangeFormula
C2:C11C2=UNIQUE(A2:A60)
E2:E10E2=UNIQUE((MONTH(C2#))&(YEAR(C2#)))
G2:G5G2=UNIQUE(YEAR(C2#))
H2:H5H2=SUMPRODUCT((YEAR($A$2:$A$60)=$G2)+0)
F2F2=SUMPRODUCT((MONTH($A$2:$A$60)=$E2)+0)
F3:F10F3=COUNTIF(A:A,E3)
D2:D11D2=COUNTIF(A:A,C2)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet1!$A$1:$A$1F3:F10, D2:D11
 
Upvote 0
Just curious, have you tried using a Pivot Table instead of Formulas? Maybe a pivot table can handle this?

Book22
AB
1
2
3Row LabelsCount of Booking Date
420206
5202112
6202232
720239
8Grand Total59
9
10
Sheet2



Book22
AB
2
3Row LabelsCount of Booking Date (Year)
41/23/20206
54/16/20216
69/1/20216
74/25/20226
86/18/20226
98/23/20226
1011/10/20226
1111/17/20222
1212/5/20226
131/7/20239
14Grand Total59
Sheet3


Book22
AB
3Row LabelsCount of Booking Date (Month)
4Jan15
5Apr12
6Jun6
7Aug6
8Sep6
9Nov8
10Dec6
11Grand Total59
Sheet4
 
Upvote 0
Is this what you need?

Note that the dates in column E use a custom format of mm/yyyy
Book2
ABCDEFGH
6NameBooking DateUnique DaysCountUnique MonthsCountUnique YearsCount
7Gomez, Victor01/23/202001/23/2020101/2020120201
8Mcginnis, Nathan Lee04/16/202104/16/2021104/2021120212
9Pedroza-Lewis, Jonathan Juan09/01/202109/01/2021109/2021120225
10Wertman, James Patrick04/25/202204/25/2022104/2022120232
11Robinson, Neal Scott06/18/202206/18/2022106/20221
12Corbray, Jacquita Louise08/23/202208/23/2022108/20221
13Balzer, Daniel Eugene11/10/202211/10/2022111/20222
14Brown, Maurice Terrell11/11/202211/11/2022101/20232
15Tenney, Nickalas John01/07/202301/07/20232
16Glossip, Larry Bruce01/07/2023
17Total101010
Sheet1
Cell Formulas
RangeFormula
C7:C15C7=UNIQUE(B7:B16)
E7:E14E7=UNIQUE(DATEVALUE(TEXT(C7#,"mm/yyyy")))
G7:G10G7=UNIQUE(YEAR($B$7:$B$16))
H7:H10H7=COUNTIFS($B$7:$B$16,">="&DATE(G7,1,1),$B$7:$B$16,"<="&DATE(G7,12,31))
F7:F14F7=COUNTIFS($B$7:$B$16,">="&E7,$B$7:$B$16,"<="&EOMONTH(E7,0))
D17,H17,F17D17=SUM(D7:D16)
Dynamic array formulas.
 
Upvote 0
Solution
The results you have are exactly how I need it.

Can you walk me through how to create this custom format?
 
Upvote 0
Nevermind, I had the format right, but I incorrectly copied the formula.

Thank you for your help! :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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