Count Excel Dates When Cells Include Times
Question details
Count records that match a date in another cell when the source values also include times.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains timestamps or ISO date-time text, and the user wants to count records for the date in Z2.
- Observed behavior
- The desired count includes all records for the selected calendar date, regardless of the time shown.
Check whether the source cells contain real Excel date-time values or ISO-formatted text; the formula depends on the stored value, not just its display. Make sure Z2 contains a valid Excel date without a time component.
Count real date-time values with COUNTIFS
Use this method when Excel stores the source timestamps as numeric date-time values.
Enter the date to count in Z2, with no time component.
In an empty cell, enter =COUNTIFS('2022 Data'!I1:I5000,">="&Z2,'2022 Data'!I1:I5000,"<"&Z2+1). Adjust the sheet name and range to match your data.
Press Enter. The formula counts timestamps from the start of the date in Z2 up to, but not including, the start of the next day.

Count ISO date-time text with COUNTIF
Use this method when source cells contain text beginning with an ISO date, such as 2022-03-03T15:26:24.000Z.
Count Timestamp Dates in WPS Spreadsheet
Use COUNTIFS for stored date-time values or COUNTIF with a wildcard for ISO date text in WPS Spreadsheet.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your Excel workbook.
- 2. Enter the target date: Enter the date to count in Z2, without a time component.
- 3. Choose a formula: For real date-time values, enter =COUNTIFS('2022 Data'!I1:I5000,">="&Z2,'2022 Data'!I1:I5000,"<"&Z2+1) in an empty cell. For ISO text, enter =COUNTIF('2022 Data'!I1:I5000,TEXT(Z2,"yyyy-mm-dd")&"*") instead.
- 4. Review the result: Press Enter and check the count. Update the sheet name and cell range in the formula if your data is elsewhere.

Frequently Asked Questions
Why doesn't COUNTIF match a date when the cell also contains a time?
A real Excel timestamp includes a fractional time value, so it is not equal to the date at midnight. Use COUNTIFS with a lower bound of Z2 and an exclusive upper bound of Z2+1.
How do I tell whether a timestamp is text or a real date-time value?
In an empty cell, enter =ISNUMBER(I1). TRUE indicates a numeric value; if the cell displays a timestamp, it is likely a real Excel date-time value. FALSE indicates it is not numeric and may be text.
Can the text formula count ISO timestamps with a Z at the end?
Yes. COUNTIF with TEXT(Z2,"yyyy-mm-dd")&"*" matches ISO text that starts with the selected date, including timestamps ending in Z. It does not adjust the date for a local time zone.
What if my date cell contains a time too?
For the numeric COUNTIFS formula, use INT(Z2) as the lower bound and INT(Z2)+1 as the upper bound. This removes the time portion from the target date.




