Excel Formula for This Row: Relative References
In this article
To make an Excel formula refer to "this row" — the row the formula sits in — use relative references without dollar signs, like =A2*B2, and let Excel adjust the row number automatically as you copy it down. If you need the row number itself, use =ROW(), which returns the row of the cell it lives in. If you need a value from a specific column in the current row, combine ROW() with INDEX or use a structured reference such as =[@Price]*[@Qty] inside an Excel Table. The key idea is the same in every case: anchor columns with $ if you want them fixed, but leave the row number free so it tracks the row you are in.
What You'll Need
- Excel for Microsoft 365, Excel 2021/2019, or Excel for the web. Menu names can differ slightly by version, platform and region.
- A worksheet with data laid out in columns, ideally with a header row.
- Basic familiarity with the difference between relative (
A2), absolute ($A$2) and mixed ($A2orA$2) references.
Step-by-Step
- Decide what "this row" means for your formula. Usually it means "the value in column A of the row I am on" or "the row number I am on". Write that down before touching the formula bar; it stops you anchoring the wrong part of the reference.
- Click the first cell where the formula should live. For example, click
C2if your data starts in row 2 and you want a result in column C. - Type a relative-reference formula. In
C2, type=A2*B2and press Enter. Both references are relative, so when you copy the formula toC3it becomes=A3*B3— it now points at "this row" automatically. - Use
ROW()when you need the row number. Type=ROW()in any cell and it returns that cell's row.=ROW(A2)returns 2 regardless of where the formula sits, which is useful for building sequences. - Combine
ROW()withINDEXto pull a value from the current row.=INDEX(A:A,ROW())returns the value in column A on the same row as the formula. This is handy when you cannot use a plain relative reference, such as inside some array formulas. - Lock the column, not the row, when you copy sideways. If you will drag the formula across columns and always want column A, write
=$A2. The$before A freezes the column; the free 2 still follows the row. - Copy the formula down. Select the cell, grab the fill handle (the small square at the bottom-right corner) and drag down, or double-click the fill handle to fill to the end of the adjacent data. Check a cell halfway down: the row numbers in the formula should have shifted to match.
- Prefer an Excel Table for structured references. Select your data and press Ctrl+T (Cmd+T on Mac) to create a table. A formula like
=[@Price]*[@Qty]always means "this row's Price times this row's Qty" and fills the whole column automatically as rows are added. - Verify with a spot check. Click any filled cell and read the formula bar. If it says
=A7*B7while you are on row 7, the reference is tracking the row correctly.
Common Mistakes
- Accidentally anchoring the row. Typing
=A$2*B$2and dragging down gives every row the same result, because the row is frozen at 2. Remove the dollar before the row number. - Anchoring both column and row.
=$A$2is a fixed cell, not "this row". It is the most common cause of copy-paste formulas that return identical values all the way down. - Typing row numbers by hand instead of copying. Manually writing
=A3*B3,=A4*B4works but breaks the moment rows are inserted. Relative references adjust; hard-coded numbers do not. - Mixing up
ROW()andROWS().ROW()gives the row number of a cell;ROWS(A1:A5)counts how many rows are in a range and returns 5. - Forgetting that inserting rows above shifts references. Relative references follow the cells they point at, so inserting a row above your data moves the references down with the data — usually what you want, but check after any structural edit.
Tips
- Press F4 while editing a reference to cycle through relative, absolute and the two mixed forms. It is faster and less error-prone than typing dollar signs.
- Use Ctrl+` (the key left of 1) to toggle showing formulas instead of results, so you can scan a whole column and confirm the row numbers increment by one.
- When a formula must always read the same column but the current row, the pattern
=INDEX($A:$A,ROW())is robust against column inserts elsewhere on the sheet. - Name your tables descriptively. Structured references read like plain English and survive column reordering, unlike
A2-style references. - If you copy a formula to another sheet, relative references still point at the original sheet unless you include the sheet name, so verify after pasting.
Troubleshooting
- Every row shows the same answer. You anchored the row with
$. Click the first cell, remove the dollar signs before the row numbers, and re-fill. - The formula shows
#REF!after copying. The reference pointed outside the sheet boundary — for example, copying a formula that refers to row 1 upward from row 1. Undo with Ctrl+Z and check the direction you filled. - Results are off by one row. Your data probably starts in row 1 with headers, but the formula in row 2 refers to row 1. Adjust the first formula so it lines up, then re-fill.
- New rows do not get the formula. Plain ranges do not auto-extend. Convert the range to a table (Ctrl+T) so structured-reference formulas fill down automatically, or copy the formula into the new rows.
ROW()returns an unexpected number. It returns the row of the cell containing the formula, not of the data you are looking at. If the formula sits in a different row from the data, use an explicit reference orINDEXwith a calculated row.- Calculation seems frozen. Check that calculation is set to Automatic under Formulas > Calculation Options. If it is set to Manual, press F9 to recalculate.
Frequently Asked Questions
How do I reference the entire current row in a formula?
Use a whole-row reference like 1:1 only for a fixed row. For the current row, combine ROW() with INDEX, for example =SUM(INDEX(A:XFD,ROW(),0)), which sums the whole of the row the formula is on.
What is the difference between A2 and $A$2?
A2 is relative and shifts when copied. $A$2 is absolute and always points at cell A2. $A2 and A$2 are mixed: one part stays fixed, the other moves.
Can I make a formula always look at the row above?
Yes. In row 3, write =A2; when copied down it becomes =A3, =A4 and so on, always one row up. To lock it to a specific row above, anchor that row with $.
Why does my formula change when I sort the data?
Relative references follow the cells they point at, so after sorting they may point at different values. If the formula must stay tied to specific records, convert the range to a table; structured references move with their rows when sorted.
Does ROW() work in Excel for the web and on Mac?
Yes, ROW() and relative references behave the same across Excel for Windows, Mac and the web. Menu locations for calculation options and table creation can differ slightly by version and platform.
How do I stop a formula from changing row numbers when I copy it?
Anchor the row with a dollar sign, as in A$2. That freezes the row while leaving the column free to shift — the opposite of what you need for "this row" formulas, so use it only when you genuinely want a fixed row.