Function Problems

Create a Copyable COUNTIFS Formula Across Excel Employee Sheets

Anum MushtaqAnum Mushtaq Nov 22, 2026 869 views

Question details

Create a formula that counts monthly absence entries across separate employee worksheets and can be copied down and across a summary sheet.

Create a Copyable COUNTIFS Formula Across Excel Employee Sheets
Product
Microsoft Excel
Device & OS
not provided
Scenario
An absence workbook has one worksheet per employee, with dates in column A and occurrence values in column D.
Observed behavior
The desired formula should switch employee worksheets when copied down and switch months when copied across.
Before you start

Check that each employee sheet has dates in column A and occurrence values in column D, and decide whether you need to count entries or sum their values. On a summary sheet, reserve column A for exact employee sheet names and row 1 for actual first-of-month dates.

Solution 1Recommended

Use INDIRECT and COUNTIFS to count monthly entries

Use this formula to count rows with a positive occurrence value for each employee and month.

The mixed references $A2 and B$1 let the employee sheet change when the formula is copied down and the month change when it is copied across. INDIRECT builds the sheet references, while EOMONTH defines the end of the month.

Each matching row counts as one, even if its occurrence value is 0.5. The formula also includes dates with time values on the last day of the month.

1
List employee sheets

On your summary sheet, enter each employee worksheet name in column A, starting in A2. The names must match the sheet tabs exactly.

2
Set month headers

Enter a real first-of-month date in B1, such as 1/1/2019. In C1, enter =EDATE(B1,1) and copy it across to create later month headers.

3
Enter the formula

In B2, enter =COUNTIFS(INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!A:A"),">="&B$1,INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!A:A"),"<"&EOMONTH(B$1,0)+1,INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!D:D"),">0").

4
Copy the formula

Select B2 and drag its fill handle down for the employee rows, then across for the month columns. Check a result against the corresponding employee sheet.

Use INDIRECT and COUNTIFS to count monthly entries
Adjust the criterion: The >0 criterion excludes blanks, zeros, and negative values. Change it if your occurrence data uses a different convention. INDIRECT with full-column ranges can slow large workbooks; use consistent bounded ranges if needed.
WPS Spreadsheets

Build the monthly absence summary in WPS Spreadsheets

Use WPS Spreadsheets to create the same employee-by-month summary with COUNTIFS, INDIRECT, and EOMONTH, then save the workbook in Excel format.

  1. 1. Open the workbook: In WPS Spreadsheets, use Open to select the absence workbook, then open or add a summary sheet.
  2. 2. Add names and dates: Enter employee sheet names in A2 and below. Enter a first-of-month date in B1, then use =EDATE(B1,1) in C1 and fill across.
  3. 3. Enter the count formula: In B2, enter =COUNTIFS(INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!A:A"),">="&B$1,INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!A:A"),"<"&EOMONTH(B$1,0)+1,INDIRECT("'"&SUBSTITUTE($A2,"'","''")&"'!D:D"),">0").
  4. 4. Fill and save: Drag the fill handle down and across, verify the results, and use Save As to save an XLSX workbook.
Copy one formula across employee rows and month columnsCount positive absence entries by monthOpen and save Microsoft Excel XLSX workbooksWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula show a reference error?

Check that the name in column A of the summary sheet exactly matches an employee sheet tab. INDIRECT cannot resolve a sheet name that does not exist.

Why does a 0.5 occurrence count as one?

COUNTIFS counts matching rows, not the values in column D. Use the SUMIFS solution if 0.5 should contribute half an occurrence to the monthly total.

Can the formula include dates that have times?

Yes. The condition <EOMONTH(B$1,0)+1 includes all times on the last day of the month, provided column A contains real Excel date and time values.

Why are the month results incorrect?

Check that each header in row 1 is a real date set to the first day of its month, not text. Also verify that employee dates in column A are stored as dates.

How can I improve performance in a large workbook?

Replace full-column references such as A:A and D:D inside INDIRECT with consistent bounded ranges, such as A2:A1000 and D2:D1000, that cover your data.