Use Fill to Copy a Formula to Highlighted Cells
In this article
To copy a formula to highlighted cells, select the cell with the formula, copy it, highlight the destination range, and use the Fill command (or drag the fill handle) to paste the formula down or across. In Excel, the fastest keyboard method is Ctrl+C on the source cell, select the target range, then Ctrl+D (fill down) or Ctrl+R (fill right). This guide walks through the reliable methods, what can go wrong, and how to fix it.
What You'll Need
- Excel, Google Sheets, or another spreadsheet app with a Fill feature (steps below use Excel and Google Sheets; menu labels may differ slightly by version, device, or region).
- A worksheet with at least one formula already entered in a cell.
- Basic familiarity with selecting cells and ranges.
Step-by-Step
- Enter the formula in the first cell. Type your formula (for example,
=A2*B2) and press Enter. Confirm it returns the result you expect before copying it anywhere. - Select the source cell. Click the cell containing the formula. If you want to copy it to several non-adjacent cells, you can copy first and then select multiple ranges while holding Ctrl (Windows) or Command (Mac).
- Copy the formula. Press Ctrl+C (Windows) or Command+C (Mac), or right-click and choose Copy. A moving dashed border appears around the cell.
- Highlight the destination cells. Click and drag to select the range where the formula should go. Include the source cell if you are filling down or right from it, or select only the empty cells below or beside it. The highlighted area is where the fill will apply.
- Use the Fill command. On Windows, go to the Home tab, find the Editing group, click Fill, and choose Down, Right, Up, or Left. On Mac, use the same Home tab > Fill menu. In Google Sheets, use Edit > Fill > Down (or Right) after selecting the range. The formula is copied into every highlighted cell, with relative references adjusted automatically.
- Alternatively, drag the fill handle. With the source cell selected, hover over the small square at the bottom-right corner of the cell (the fill handle) until the cursor becomes a black cross, then drag down or across over the highlighted cells. Release to fill. This works in Excel and Google Sheets.
- Check the results. Click a filled cell and look at the formula bar to confirm the references shifted correctly (for example, A2 became A3). If you see the same value repeated or a reference error, undo with Ctrl+Z and try a different method.
Common Mistakes
- Filling without copying first. The Fill command works on the selected range, but if the top cell of the range does not contain the formula, you will fill blanks or repeat the wrong value. Always confirm the source cell is included or copied.
- Using absolute references by accident. If your formula uses
$A$2, filling down will keep pointing to A2 in every row. Remove the dollar signs for references that should change, or add them deliberately for fixed values. - Selecting the wrong range shape. Fill Down expects a vertical range; Fill Right expects a horizontal one. Mixing them can overwrite data or leave cells empty.
- Overwriting existing data. Filling into cells that already contain values replaces them without warning. Check the highlighted area before you fill.
- Dragging the fill handle too far. It is easy to overshoot the intended range. Release carefully and undo if needed.
Tips
- Double-click the fill handle in Excel to fill down automatically to the end of the adjacent data column, which is faster than dragging for long lists.
- Use Ctrl+D (fill down) and Ctrl+R (fill right) as quick keyboard shortcuts in Excel after selecting the range.
- To copy a formula without changing references, copy the cell, then use Paste Special > Formulas, or edit the formula and press F4 to toggle absolute references before filling.
- In Google Sheets, you can also copy a cell and paste it into a selected range; the formula adjusts relative to each destination cell.
- If you need the same formula in scattered cells, select them with Ctrl (Windows) or Command (Mac) and use Fill Down; Excel fills each selected cell based on the cell above it.
Troubleshooting
- The formula did not copy; the same value appears everywhere. This usually means the formula uses absolute references or you copied a value instead of a formula. Check the formula bar and remove unnecessary dollar signs.
- I see #REF! or #VALUE! errors after filling. The relative references may point to empty or invalid cells. Undo, then adjust the formula so references stay within valid data.
- The Fill command is greyed out. Make sure you have selected a range that includes the source cell or that you copied a cell first. In some views (like Page Layout), certain commands are limited; switch to Normal view.
- The fill handle is missing. Enable it in Excel under File > Options > Advanced > Editing options > Enable fill handle and cell drag-and-drop. In Google Sheets, the fill handle appears when a single cell or range is selected.
- Filling overwrote my data. Press Ctrl+Z (Windows) or Command+Z (Mac) immediately to undo. To avoid this, always verify the highlighted range before filling.
- Formulas copy but formatting does not. The Fill command copies content, not necessarily formatting. Use Format Painter or copy and Paste Special > Formats separately if needed.
Frequently Asked Questions
Can I fill a formula to non-adjacent cells?
Yes. Select the source cell, copy it, then hold Ctrl (Windows) or Command (Mac) and click each destination cell. Use Fill Down or paste; Excel applies the formula to each selected cell relative to its position.
What is the difference between Fill Down and dragging the fill handle?
Both copy the formula to adjacent cells. Fill Down works on a selected range and is precise; dragging is quicker for short distances but easier to overshoot. Double-clicking the fill handle in Excel fills down to the end of adjacent data.
Why does my formula show the same result in every cell after filling?
Likely because the formula uses absolute references (with $ signs) or refers to a fixed cell. Edit the formula to use relative references (like A2 instead of $A$2) before filling.
Does Fill work in Google Sheets the same way?
Yes. Select the range, then use Edit > Fill > Down (or Right). You can also drag the fill handle. Menu labels may vary slightly by version or region.
Can I fill formulas across worksheets?
Fill commands apply within the active sheet. To copy formulas to another sheet, copy the cells and paste them into the target sheet; references adjust based on the new location unless they are absolute.
How do I stop Excel from changing references when I fill?
Use absolute references ($A$1) for cells that should not change, or copy the formula and use Paste Special > Formulas to paste it without adjusting. Press F4 while editing to cycle reference types.