To create a formula that uses a range of cells in Excel, type an equals sign, enter the function name (such as SUM), then select the range with your mouse or type its address like A1:A10, close the parenthesis, and press Enter. For example, =SUM(A1:A10) adds every number in that block. The same range syntax works in AVERAGE, COUNT, MAX, MIN, and dozens of other functions, and you can also name a range to make formulas easier to read.
What You'll Need
- Excel for Windows, Mac, or Excel for the web (the steps below apply to all three; button labels can differ slightly by version and region).
- A worksheet with data arranged in rows or columns. Ranges work best when the cells you want are contiguous.
- Basic familiarity with typing in the formula bar. No add-ins or special settings are required.
Step-by-Step
- Click the cell where the result should appear. This is the cell that will hold the formula, not the first cell of your data.
- Type an equals sign (=). Excel switches into formula-entry mode and the Name Box on the left of the formula bar shows the active cell.
- Type the function name followed by an opening parenthesis. For a total, type
=SUM(. For an average, type=AVERAGE(. As you type, Excel shows a function tooltip listing the arguments. - Select the range with the mouse. Click the first cell, hold the left mouse button, and drag to the last cell. Excel inserts the range address automatically, for example
B2:B15. Release the mouse and the range is highlighted with a moving dashed border. - Or type the range address manually. Type the top-left cell, a colon, and the bottom-right cell, such as
B2:B15. A colon means "through" and includes both endpoints. For a non-adjacent range, separate the blocks with a comma:B2:B15,D2:D15. - Close the parenthesis and press Enter. The formula is calculated and the result appears in the cell. Click the cell again to see the formula in the formula bar and the colored range outline on the sheet.
- Copy the formula down or across if needed. Drag the fill handle (the small square at the bottom-right corner of the selected cell) to apply the same range pattern to other rows or columns. Relative references adjust automatically; use dollar signs like
$B$2:$B$15if the range must stay fixed. - Optional: name the range for readability. Select the cells, click the Name Box, type a name such as
SalesData, and press Enter. You can then write=SUM(SalesData)instead of the cell addresses. Names must start with a letter or underscore and cannot contain spaces.
Common Mistakes
- Forgetting the colon. Typing
B2 B15orB2-B15does not define a range and usually produces an error or a wrong result. - Including the header row. A range like
A1:A20that includes a text header will be ignored by SUM but can skew AVERAGE or COUNT if the header is numeric-looking text. Start the range at the first data cell. - Using a comma as the range separator. In some regional settings the argument separator is a semicolon, so
=SUM(A1:A10;B1:B10)may be required. If Excel rejects a comma, check your regional list separator. - Leaving out the closing parenthesis. Excel usually offers to fix it, but accepting the suggestion blindly can produce a formula that references the wrong cells.
- Mixing absolute and relative references carelessly. Copying
=SUM(A1:A10)one row down produces=SUM(A2:A11), which may not be what you intended. - Typing a range into a cell that already contains data. The new formula replaces the old value without warning; press Ctrl+Z (Cmd+Z on Mac) to undo.
Tips
- Use
Ctrl+Shift+Arrowto select a contiguous block quickly: place the cursor at the top of a column and press Ctrl+Shift+Down to select to the last filled cell. - Press
F4while editing a reference to cycle between relative, absolute row, absolute column, and fully absolute forms. - Use whole-column references like
A:Asparingly; they work but can slow large workbooks because Excel evaluates every row. - Use structured references if your data is in an Excel Table:
=SUM(Table1[Sales])automatically expands as rows are added. - The status bar at the bottom of the window shows Sum, Average, and Count for any selected range without writing a formula at all.
- Press
Ctrl+`(the grave accent) to toggle showing formulas instead of results, which helps audit ranges.
Troubleshooting
If the formula returns #VALUE!, one of the cells in the range contains text that the function cannot handle; check for stray spaces or labels inside the block. If it returns #REF!, a referenced cell or sheet was deleted; undo the deletion or retype the range. If the result is zero when you expect a total, the numbers may be stored as text (they often align left); select the range, use Data > Text to Columns, and click Finish to convert them. If the range outline does not appear when you click the formula cell, the reference may be to another sheet; the sheet name appears before the exclamation mark, as in Sheet2!A1:A10. If a named range stops working after rows are inserted, redefine it via Formulas > Name Manager. If Excel shows a circular reference warning, the formula's own cell is inside the range; move the formula outside the block.
Frequently Asked Questions
What does the colon mean in a range?
The colon is the range operator. A1:A10 means every cell from A1 through A10 inclusive, forming a rectangular block.
Can I use a range from another worksheet?
Yes. Prefix the range with the sheet name and an exclamation mark, for example =SUM(Sheet2!A1:A10). If the sheet name contains spaces, wrap it in single quotes: 'Q1 Sales'!A1:A10.
How do I sum a range that has blank cells?
SUM ignores blanks automatically. AVERAGE also ignores blanks, but COUNT counts only numeric cells while COUNTA counts non-empty cells, so choose the function that matches what you want to measure.
Why does my range formula change when I copy it?
References are relative by default, so they shift with the copy. Add dollar signs ($A$1:$A$10) or define a named range to keep the reference fixed.
Can a range include entire rows or columns?
Yes, for example =SUM(A:A) or =SUM(1:1). This is convenient but can slow recalculation in large workbooks, so prefer bounded ranges when performance matters.
What is the difference between a range and an array?
A range is a set of worksheet cells; an array is a set of values held in memory, often created by a formula. Functions like SUM accept both, but array formulas may need Ctrl+Shift+Enter in older Excel versions.