Count occurrences of dates across a range

ellison

Active Member
Joined
Aug 1, 2012
Messages
356
Office Version
  1. 365
Platform
  1. Windows
Hi, we are trying to count occurrences of dates across a range.

We've found ways of counting "cells which contain dates" - but not the number of actual occurrences of dates within a range.

And we found a way of counting occurrences of text strings - but they don't allow for wildcards which means we're stuck!

Wondering if there's a way of dealing with this?!


Book2
ABCDE
1IssueWIP Count of datesInfo-1Info-2Info-3
2This counts the number of cells that contain (=3) as opposed to the occurrences (=5)3_05/12/2023 Alpha Beta 05/12/202305/12/2023 Charlie 01/12/2023 Delta 05/12/2023
3This counts the occurrences, but we can't use wildcards to search for "*/??/*"4AlphaAlpha Alpha Alpha
Sheet1
Cell Formulas
RangeFormula
B2B2=COUNTIF(C2:E2,"*/??/*")
B3B3=(SUM(LEN(C3:E3)-LEN(SUBSTITUTE(C3:E3,"Alpha","")))/LEN("Alpha"))



Huge thanks for taking a lok
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Maybe like this:

=SUMPRODUCT(LEN(C2:E2)-LEN(SUBSTITUTE(C2:E2,"/","")))/2
 
Upvote 0
Solution
Nice @Phuoc, I like the simplicity. Far smarter than what I was going to propose:
Excel Formula:
=LET(ts,TEXTSPLIT(TEXTJOIN(" ",,C2:E2)," "),COUNTA(FILTER(ts,ISNUMBER(SEARCH("*/??/*",ts)))))

I suppose the only issue I can forsee by using the SUMPRODUCT option is if the / become part of any text string.
 
Upvote 0
Thanks for your suggestion, they work beautifully - suggest @Phuoc's one seems the one to go for.................. ~(based on simplicity and speed on large sets of data)

💪 💪 💪 💪
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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