Count Nonblank Excel Entries for Today or Yesterday
Question details
Count nonblank entries in column B when the corresponding date in column A is today or yesterday.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet stores dates in column A and text entries in column B; the user needs a date-based count of nonblank entries.
- Observed behavior
- The current COUNTIF expression is invalid and does not produce the desired count.
Check that column A contains real Excel dates rather than text, and determine whether the values include times. The formulas below assume dates are in column A and entries are in column B.
Count nonblank entries for a date without time values
Use COUNTIFS when column A contains date-only values.
Select an empty cell and enter =COUNTIFS(A:A,TODAY(),B:B,"<>") to count nonblank cells in column B whose date in column A is today.
In another empty cell, enter =COUNTIFS(A:A,TODAY()-1,B:B,"<>") to count entries dated yesterday.

Count nonblank entries when dates include times
Use date ranges when column A contains timestamps, because an exact date match can exclude values with a time.
Count entries by date in WPS Spreadsheets
Use COUNTIFS and TODAY in WPS Spreadsheets to count nonblank entries for today or yesterday, including dates with times.
- 1. Open the worksheet: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Check the columns: Confirm that dates are in column A and the entries to count are in column B.
- 3. Enter the formula: Select an empty cell and enter =COUNTIFS(A:A,TODAY(),B:B,"<>") for today's date-only entries, or replace TODAY() with TODAY()-1 for yesterday.
- 4. Handle timestamps if needed: If column A includes times, enter =COUNTIFS(A:A,">="&TODAY(),A:A,"<"&TODAY()+1,B:B,"<>") instead to count today's entries.

Frequently Asked Questions
Why does an exact TODAY() match miss some entries?
Cells in column A may contain times as well as dates. Use a range from >=TODAY() to <TODAY()+1 in COUNTIFS to include the whole day.
How do I count yesterday and today together?
Enter =COUNTIFS(A:A,">="&TODAY()-1,A:A,"<"&TODAY()+1,B:B,"<>") in an empty cell. This includes timestamps on both days.
What does the "<>" criterion count?
In =COUNTIFS(A:A,TODAY(),B:B,"<>"), the "<>" criterion counts nonblank cells in column B that also meet the date condition.
What if the dates in column A are stored as text?
Convert them to real Excel dates first. Select column A, then use Data > Text to Columns and choose the appropriate date format in the final step.




