Function Problems

How to Use Cell References Automatically in Excel COUNTIFS Criteria

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 869 views

Question details

The user wants to use a cell reference instead of hard-coded text in a COUNTIFS formula so the formula can be easily dragged and copied for multiple names.

How to Use Cell References Automatically in Excel COUNTIFS Criteria
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Counting specific records for multiple employees or captains without retyping names manually in the formula criteria for each row.
Observed behavior
Needs a method to replace a text string criterion with a dynamic cell reference in COUNTIFS to fill down a list automatically.
Before you start

Ensure that your source data ranges are locked with absolute references (using $ signs, like $C$2:$C$638) so they do not shift when you copy the formula down.

Solution 1Recommended

Replace Text Criteria with Relative Cell References

Modify your COUNTIFS formula to point to a cell containing the criteria, enabling automatic updates when dragging the formula.

When using functions like COUNTIFS, typing criteria manually for each row is time-consuming. Using relative cell references allows the formula to adapt to each row's specific criteria automatically while keeping the search ranges locked.

1
Locate the text criteria

Identify the static text string in your COUNTIFS formula that you want to make dynamic (for example, "Tory" or the captain's name).

2
Replace with a cell reference

Delete the quotation marks and text, and click on the cell containing the value you want to reference for that row (for example, A2).

3
Ensure source ranges are absolute

Check that your lookup ranges have dollar signs ($) locking them in place (e.g., June!$F$2:$F$638). This prevents the search area from shifting.

4
Apply and fill down

Press Enter to apply the formula, then click and drag the fill handle at the bottom-right corner of the cell down your list. The relative cell reference will automatically update to A3, A4, etc.

Replace Text Criteria with Relative Cell References
Example Formula: =COUNTIFS(June!$C$2:$C$638,"Night",June!$F$2:$F$638,A2,June!$K$2:$K$638,"Inbound",June!$M$2:$M$638,"Tory") uses A2 as the dynamic reference while keeping data ranges locked.
Master Formulas in WPS Spreadsheet

Use Advanced Formulas with WPS Spreadsheet

WPS Spreadsheet offers powerful data analysis tools, including full support for complex COUNTIFS formulas with absolute and relative cell references, making large data calculations a breeze.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the data to be counted.
  2. 2. Enter the COUNTIFS formula: Select the target cell, type =COUNTIFS(, and select your absolute lookup ranges and the relative cell criteria (e.g., A2).
  3. 3. Use the Fill Handle: Hover over the bottom right corner of the formula cell until the cross cursor appears, then drag down to apply the dynamic formula to the rest of the column.
Fully compatible with Microsoft Excel formulas and functionsIntuitive formula builder and syntax auto-completionFree and lightweight alternative for spreadsheet managementSeamless handling of large datasets with multi-condition criteria
microsoft office alternative - wps office

Frequently Asked Questions

Why is my COUNTIFS formula returning zero when I drag it down?

This usually happens if your criteria ranges are not locked. Ensure you use absolute references (like $A$2:$A$100) for the source data ranges so they don't shift downwards when copying the formula.

Can I use multiple cell references in one COUNTIFS formula?

Yes, COUNTIFS supports up to 127 range and criteria pairs. You can replace any or all of the hard-coded text criteria in your formula with dynamic cell references.

How do I add greater than or less than operators to a cell reference in COUNTIFS?

To combine logical operators with a cell reference, enclose the operator in quotation marks and use the ampersand (&) to join it to the cell reference. For example: ">"&A2.