Count Records by Month, Year, and Entity in Excel
Question details
Count records that match a specified month, year, and entity.

- Product
- Excel or WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A user wants to count new hires for Entity Pluto in a selected month and year.
- Observed behavior
- The desired result is a count of rows whose entity and date match all the selected criteria.
Check whether the values in the date column are real spreadsheet dates or text such as "July 2024". Identify the entity and date ranges, and make sure they cover the same rows.
Count matching records using real dates
Use date boundaries when the date column contains real spreadsheet dates, including dates with times.
Enter the target year in A5, the month number in B5, and the entity name in C8. For example, use 2024, 7, and Entity Pluto.
Select an empty result cell and enter =COUNTIFS('Employee Data'!$I$8:$I$18,$C8,'Employee Data'!$Q$8:$Q$18,">="&DATE($A$5,$B$5,1),'Employee Data'!$Q$8:$Q$18,"<"&EDATE(DATE($A$5,$B$5,1),1)).
Replace 'Employee Data'!$I$8:$I$18 with your entity range and 'Employee Data'!$Q$8:$Q$18 with your date range. Keep the ranges the same size and aligned to the same rows.

Count matching records using month-and-year text
Use a wildcard when the date column stores text that starts with the month and ends with the year.
Count monthly records by entity in WPS Spreadsheets
Use COUNTIFS in WPS Spreadsheets to count rows for an entity within a selected month and year.
- 1. Open the workbook: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Set the criteria: Enter the year in A5, the month number in B5, and the entity in C8, or choose equivalent cells in your workbook.
- 3. Add the formula: Select a result cell and enter =COUNTIFS('Employee Data'!$I$8:$I$18,$C8,'Employee Data'!$Q$8:$Q$18,">="&DATE($A$5,$B$5,1),'Employee Data'!$Q$8:$Q$18,"<"&EDATE(DATE($A$5,$B$5,1),1)).
- 4. Adapt and check: Replace the sheet name and ranges with your own, press Enter, and check the result against the matching rows.

Frequently Asked Questions
Why does the date formula return zero when matching records exist?
Check that the date column contains real dates rather than text. Also verify that A5 contains the year, B5 contains a month number from 1 to 12, and C8 matches the entity text.
Will the formula count dates that include a time?
Yes. The real-date formula uses a lower bound of the first day of the month and an exclusive upper bound of the first day of the next month, so times within the selected month are included.
Can I use a month name instead of a month number?
For real dates, enter the corresponding month number in B5, such as 7 for July. For month-and-year text, enter the month name in Q7 and use the wildcard formula.
Why must the COUNTIFS ranges cover the same rows?
COUNTIFS compares criteria across corresponding cells. Use ranges of the same size, such as I8:I18 for entities and Q8:Q18 for dates, so each entity is compared with the date on the same row.




