Count Records by Source and Month with COUNTIFS in Excel
Question details
Count records that match both a specified source and a month using COUNTIFS.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains case records with source and month information, and the user wants a count for a selected combination.
- Observed behavior
- The desired result is a count of rows that meet both criteria.
Identify the source and month columns and check that their ranges cover the same rows. Determine whether the month column contains text such as April or actual Excel dates.
Count a source and text month with COUNTIFS
Use this method when the month column contains month names as text.
Click an empty cell where you want the count to appear.
Enter =COUNTIFS(A2:A100,"HP",B2:B100,"April") and press Enter. Replace A2:A100 with your source range and B2:B100 with your month range.
To use values in Sheet2 cells A1 and B1 instead, enter =COUNTIFS(A2:A100,Sheet2!A1,B2:B100,Sheet2!B1). Put the source in Sheet2!A1 and the month name in Sheet2!B1.
Count a source within a calendar month of dates
Use date boundaries when the month information is stored as actual Excel dates.
Count Sources and Months in WPS Spreadsheets
Use COUNTIFS in WPS Spreadsheets to count rows that match a source and a text month, including criteria stored on another sheet.
- 1. Open your workbook: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Select a result cell: Click an empty cell where you want the count.
- 3. Enter the formula: Type =COUNTIFS(A2:A100,"HP",B2:B100,"April") and press Enter. Adjust the ranges and criteria to match your worksheet.
- 4. Save your workbook: Select File > Save or Save As to keep the formula in your workbook.

Frequently Asked Questions
Why does COUNTIFS return zero for April?
Check whether the month cells contain the text April or actual dates. If they are dates, use a start-of-month and next-month boundary instead of the text criterion "April".
Can I put the source and month criteria on another sheet?
Yes. For example, enter =COUNTIFS(A2:A100,Sheet2!A1,B2:B100,Sheet2!B1), with the source in Sheet2!A1 and the month in Sheet2!B1.
Do the COUNTIFS ranges have to be the same size?
Yes. Each criteria range must have the same dimensions and cover corresponding rows, such as A2:A100 and B2:B100.
How do I count April records for only one year?
If the month column contains dates, use a lower boundary of April 1 of the target year and an upper boundary of May 1. If it contains text month names, add a separate year range and criterion to COUNTIFS.




