How to Use Cell References Automatically in Excel COUNTIFS Criteria
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.

- 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.
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.
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.
Identify the static text string in your COUNTIFS formula that you want to make dynamic (for example, "Tory" or the captain's name).
Delete the quotation marks and text, and click on the cell containing the value you want to reference for that row (for example, A2).
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.
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.

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. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the data to be counted.
- 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. 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.

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.




