Formula Errors

Make the Week Number Increase When Copying an Excel COUNTIF Formula

Adam DavisAdam Davis Nov 13, 2026 868 views

Question details

The user needs the week-number criterion in a COUNTIF formula to increase automatically when the formula is copied downward.

Product
Microsoft Excel
Device & OS
not provided
Scenario
Count entries for consecutive week numbers in column B of the Raw Data worksheet without manually editing each formula.
Observed behavior
A number typed directly into the COUNTIF formula stays unchanged when the formula is filled down.
Before you start

Confirm that week numbers are stored in column B of the Raw Data worksheet, and decide whether the first count should use week 1 or week 25. These formulas match week numbers; they do not calculate week numbers from dates.

Solution 1Recommended

Use ROW to increase the COUNTIF criterion automatically

Use this method to count consecutive week numbers without adding a helper column.

A numeric constant does not change when you copy a formula. ROW(1:1) returns 1, and its relative reference changes to ROW(2:2), ROW(3:3), and so on as you fill downward.

1
Enter the formula for the first week

Select the first output cell and enter =COUNTIF('Raw Data'!B:B,ROW(1:1)) to start at week 1. To start at week 25, enter =COUNTIF('Raw Data'!B:B,ROW(1:1)+24) instead.

2
Fill the formula downward

Press Enter, select the formula cell again, and drag the fill handle at its bottom-right corner down through the required output rows.

3
Check the next formula

Click the second output cell and inspect the formula bar. The criterion should be ROW(2:2), or ROW(2:2)+24 if you started at week 25.

The starting cell does not determine the first week: ROW(1:1) returns 1 even if the formula is entered farther down the worksheet. Adding 24 makes the first criterion 25.
Count consecutive weeks in WPS Spreadsheet

Automatically Increase COUNTIF Week Criteria in WPS Spreadsheet

WPS Spreadsheet supports COUNTIF, ROW, and fill-down formulas, so you can generate consecutive week criteria directly in your workbook without editing each formula.

  1. 1. Open the workbook: In WPS Spreadsheet, choose File > Open and select the workbook containing the Raw Data worksheet.
  2. 2. Enter the dynamic COUNTIF formula: Click the first summary result cell and enter =COUNTIF('Raw Data'!B:B,ROW(1:1)+24) to start counting at week 25. Remove +24 to start at week 1.
  3. 3. Fill down for additional weeks: Press Enter, reselect the formula cell, and drag the bottom-right fill handle down through the remaining summary rows.
  4. 4. Verify the increasing criterion: Click the next result cell and check the formula bar for ROW(2:2)+24. This criterion counts week 26, while subsequent rows count weeks 27, 28, and onward.
Generate week criteria starting at 1, 25, or another number using ROW and an offset.Open and save Microsoft Excel .xlsx and .xls workbooks.Use familiar formula-bar and fill-handle controls to copy formulas.Display week numbers in a helper column when you need a custom sequence.
microsoft office alternative - wps office

Frequently Asked Questions

Why does 25 stay unchanged when I drag my COUNTIF formula down?

In a formula such as =COUNTIF('Raw Data'!B:B,25), 25 is a numeric constant, not a cell reference. Fill-down adjusts relative references but does not increment constants. Replace 25 with ROW(1:1)+24 or a reference to a cell containing the week number.

How do I start the sequence at a week other than 1 or 25?

Add one less than your starting week to ROW(1:1). For example, enter =COUNTIF('Raw Data'!B:B,ROW(1:1)+9) to start at week 10, then drag the fill handle down.

Can I count selected weeks instead of consecutive weeks?

Yes. Type the desired week numbers, such as 25, 27, and 30, into A2:A4 on your summary worksheet. Enter =COUNTIF('Raw Data'!B:B,A2) in B2 and fill down to count each listed week.

Will this formula work if column B contains dates?

Not directly. The formula compares values in column B with week numbers, but spreadsheet dates are stored as date serial numbers. Create a helper column with =WEEKNUM(B2,2) for Monday-start weeks, or =ISOWEEKNUM(B2) for ISO week numbering, fill it down, and point COUNTIF to that helper column. If the data spans multiple years, also filter or include the year so matching week numbers from different years are not combined.