Formula Errors

How to Keep SUMIF Ranges Fixed When Copying Formulas

Anum MushtaqAnum Mushtaq Nov 3, 2026 869 views

Question details

The user needs to prevent the criteria range and sum range in a SUMIF formula from shifting rows when dragging or copying the formula down.

How to Keep SUMIF Ranges Fixed When Copying a Formula
Product
Spreadsheets
Device & OS
not provided
Scenario
Copying or dragging a SUMIF formula down a column to calculate sums for multiple criteria.
Observed behavior
The criteria range and sum range move to different rows dynamically, causing incorrect calculation results because the reference shifts away from the actual data.
Before you start

Identify the exact ranges in your spreadsheet that contain the source data (which must remain fixed) versus the criteria cells that should change dynamically for each new row.

Solution 1Recommended

Lock Ranges Using Absolute References

Use absolute cell referencing by adding dollar signs ($) to the column letters and row numbers in your formula. This anchors the data range so it stays perfectly in place when copied.

In spreadsheet applications, cell references are relative by default. This means they automatically shift when you move or copy a formula. By converting these references to absolute references, you tell the program to lock onto those specific cells regardless of where the formula is pasted.

1
Select the formula cell

Click on the cell containing your original SUMIF formula that needs to be corrected.

2
Enter edit mode

Click into the formula bar at the top of the screen or double-click the cell to begin editing.

3
Apply absolute references

Highlight the criteria range (e.g., A2:A50) and press the F4 key on your keyboard. This will automatically add dollar signs to make it $A$2:$A$50. Do the same for your sum range (e.g., C2:C50 to $C$2:$C$50).

4
Keep the criteria dynamic

Ensure the specific criteria cell reference (e.g., B2) does not have dollar signs, allowing it to update properly as you drag the formula down to the next rows.

5
Copy the formula

Press Enter to save the changes, then click and drag the fill handle (the small square at the bottom-right of the cell) down to copy the updated formula to the rest of your column.

Lock Ranges Using Absolute References
Keyboard Shortcut Tip: Pressing the F4 key while your cursor is inside a cell reference in the formula bar will quickly toggle between relative, absolute, and mixed references, saving you from typing the dollar signs manually.
Efficient Spreadsheet Calculations

Master Formulas Easily with WPS Spreadsheet

WPS Spreadsheet provides intuitive formula building tools, automatic syntax checking, and full compatibility with Excel's formula engine, making complex calculations like SUMIF incredibly easy to manage.

  1. 1. Open your workbook: Launch WPS Office and open your spreadsheet file containing the data.
  2. 2. Enter the SUMIF formula: Type =SUMIF( into your target cell. WPS Spreadsheet will instantly prompt you with the required syntax arguments.
  3. 3. Lock the ranges with F4: Select your data ranges with your mouse and simply press F4 to instantly lock them with absolute references.
  4. 4. Drag to fill: Grab the fill handle at the corner of your cell and drag it down to apply the fixed formula flawlessly across all rows.
100% compatible with Microsoft Excel formulas and formats (.xlsx)Built-in formula suggestions and error-checking toolsFree and lightweight office suite for Windows, Mac, and LinuxSupports seamless one-click absolute referencing with the F4 key shortcut
microsoft office alternative - wps office

Frequently Asked Questions

What does the F4 key do in spreadsheet formulas?

The F4 key is a shortcut used while editing a formula to cycle through reference types. Pressing it once changes a relative reference (A1) to an absolute reference ($A$1), locking both the column and the row.

Why is my SUMIF returning 0 when I copy it down?

This typically happens if your criteria and sum ranges are not locked with dollar signs. As you copy the formula down, the reference ranges shift down with it, eventually pointing to empty cells and returning a calculation of 0.

Can I lock just the row or just the column in my formula?

Yes, this is called a mixed reference. By cycling through with the F4 key or manually typing, you can lock just the row (e.g., A$1) so the formula can be dragged across columns, or lock just the column (e.g., $A1) so it can be dragged down rows.