How to Count Specific Times Stored as Text in Excel Cells
Question details
The user needs to count occurrences of a specific time (e.g., 6:00) when multiple times are stored together as a single text string separated by commas in a cell, avoiding false matches from similar substrings.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing or summarizing log data where multiple timestamps are combined into single cell text strings separated by commas.
- Observed behavior
- Standard search or count functions falsely match partial times (e.g., matching '6:00' inside '16:00'), requiring a delimiter-aware formula to extract exact counts.
Ensure your time values share a consistent delimiter format (like a comma followed by a space) and identify the exact range of cells containing your text data before applying the formulas.
Count Exact Time Matches Using SUM and SEARCH
This delimiter-aware formula checks for an exact match by temporarily adding commas to both the search string and the target text, preventing partial matches.
By appending delimiters to the target string, you guarantee that a search for '6:00' doesn't accidentally count '16:00' or '26:00'. The SEARCH function identifies the exact text block, ISNUMBER converts the find to a Boolean, and SUM totals the matching instances.
Click on the blank cell where you want the final count to appear.
Enter the formula =SUM(--ISNUMBER(SEARCH(", 6:00,", ", "&C10:C15&", "))) into the formula bar. Ensure you adjust the range C10:C15 to match your data.
Press Enter to execute the formula. If you are using an older version of Excel that does not support dynamic arrays, you may need to press Ctrl+Shift+Enter.

Calculate Occurrences Using String Length Differences
This alternative calculates counts by substituting the specific time with empty space and comparing the character length of the original text to the new text.
Create a Dynamic Summary Table of All Times
If you need a complete list of every unique time mentioned along with its total count across all cells, use the modern TEXTSPLIT and LET functions.
Count and Analyze Text Data Efficiently in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, including LET, TEXTSPLIT, and ISNUMBER, allowing you to manipulate and analyze text strings effortlessly. It offers seamless performance for complex data summaries and is highly compatible with existing workbooks.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your comma-separated times.
- 2. Input the array formula: Select an empty cell and type in your preferred SUM or LET formula as outlined above.
- 3. Calculate instantly: Press Enter to instantly process the text strings and display accurate occurrence counts across your specified data range.

Frequently Asked Questions
Why does my standard COUNTIF formula match the wrong times?
Standard wildcard counts like =COUNTIF(range, "*6:00*") look for the characters '6:00' anywhere in the text. This means it will accidentally match '16:00' or '26:00'. To fix this, you must explicitly include the delimiters (like a comma and space) in your search criteria.
Do these array formulas work in older versions of Excel?
The =SUM(--ISNUMBER(SEARCH(...))) method works in older versions but requires pressing Ctrl+Shift+Enter to evaluate as an array. Formulas relying on LET, TEXTSPLIT, or UNIQUE require Microsoft 365 or modern, updated versions of WPS Office.
How can I change the formula if my times are separated by semicolons?
Simply modify the delimiter inside the formula. Replace the comma and space ", " in the SEARCH strings or LET variables with a semicolon and space "; " to match your actual data delimiter.
Can I reference a cell instead of typing '6:00' directly into the formula?
Yes. Instead of typing ", 6:00," into the SEARCH function, you can concatenate a cell reference like this: ", " & A1 & "," where cell A1 contains the exact time you want to count.




