Excel Formula to Calculate Range of Numbers
In this article
The range of a set of numbers is the difference between the highest value and the lowest value: MAX minus MIN. In Excel, if your numbers are in cells A2 through A20, the formula is =MAX(A2:A20)-MIN(A2:A20). That single formula returns the spread of your data in one step, and it ignores blank cells and text automatically. You do not need to sort the data first or use an array formula. All you need is a column or row of numeric values and a cell to put the result in.
Range is useful for quick checks: how much did monthly sales vary, what was the gap between the fastest and slowest delivery, how wide was the temperature swing. It is a single number, so it hides the shape of the data, but it is the fastest way to see the total spread.
What You'll Need
- A spreadsheet open in Excel (desktop, web, or mobile app) with at least two numbers in one column or row.
- An empty cell beside or below your data for the result.
- Numbers stored as real numbers, not text. If some cells are left-aligned by default or show a green triangle in the corner, they may be stored as text and will be ignored by MAX and MIN.
Step-by-Step
- Identify your data range. Click the first number and note the cell reference in the Name Box (top left, e.g. A2). Scroll to the last number and note that reference (e.g. A20). Your range is then A2:A20. If the numbers are in a single block with no gaps, clicking inside the block and pressing Ctrl+A (Cmd+A on Mac) selects the whole region.
- Click an empty cell where you want the range to appear. Leave at least one blank row below your data so the formula does not get confused with the block if you later add numbers.
- Type the formula. Begin with an equals sign, then type
MAX(, select or type your range, close the bracket, type a minus sign, thenMIN(, the same range, and a closing bracket. For the example above:=MAX(A2:A20)-MIN(A2:A20). The easiest way to enter the range is to drag over it with the mouse after typing the opening bracket. - Press Enter. The cell shows the difference between the largest and smallest number. If it shows 0, either all values are the same or the cells contain text instead of numbers.
- Label the result. In the cell to the left, type something like Range so the number is not mistaken for something else. This matters more than it sounds, because a bare number in a sheet gets misread quickly.
- Check the extremes. Put
=MAX(A2:A20)in one cell and=MIN(A2:A20)in another, next to the range formula. If the range looks wrong, these two numbers tell you immediately which end is off. For example, if MAX returns an absurdly large figure, a date or a stray number has crept into the column. - Lock the range for reuse. If you plan to copy the formula down or across, press F4 after selecting the range to make it absolute, so it reads
=MAX($A$2:$A$20)-MIN($A$2:$A$20). Without the dollar signs, copying the formula shifts the range and gives misleading answers. - Handle changing data with a table. If you add rows regularly, convert your data to an Excel Table (select it, then Insert > Table, or press Ctrl+T). Formulas that refer to table columns adjust automatically as rows are added, so the range stays correct without editing.
An alternative for a full summary is the formula =MAX(A2:A20)-MIN(A2:A20) inside a single cell combined with a text label, for example ="Range: "&MAX(A2:A20)-MIN(A2:A20). Note that the text concatenation version needs the arithmetic wrapped carefully, because text joins and subtraction do not always evaluate in the order you expect. Keeping the number and label in separate cells is cleaner.
Common Mistakes
- Selecting a range that includes headers or totals. A header row containing text is ignored by MAX and MIN, but a total row at the bottom is a number and will usually become the maximum, inflating the range. Keep headers and totals outside the range.
- Numbers stored as text. Values imported from another system often arrive as text. MAX and MIN skip them silently, so the range may be calculated from only part of your data. Fix by selecting the column and using Data > Text to Columns > Finish, or multiply by 1 in a helper column.
- Forgetting absolute references when copying. A relative range shifts as the formula moves, so the same formula copied down can cover a different set of cells than intended.
- Using MIN and MAX the wrong way round. Typing
=MIN(A2:A20)-MAX(A2:A20)gives a negative number. If your result is negative, swap them. - Including hidden rows unintentionally. MAX and MIN include values in hidden or filtered-out rows. If you want the range of only the visible filtered rows, use
SUBTOTALwith the appropriate function number for visible-only maximum and minimum instead. - Typing the range with a space instead of a colon.
A2 A20is not a range; it must beA2:A20. Excel will usually flag this, but the error message can be vague.
Tips
- Name your range instead of typing cell references each time. Select the cells, type a name in the Name Box, press Enter, then use
=MAX(MyData)-MIN(MyData). Formulas become far easier to read. - Press F4 in the formula bar to cycle through absolute and relative references without typing dollar signs.
- Use the Formula AutoComplete: type
=MAX(and Excel suggests functions and shows the argument tooltip. - For a one-off check, select the numbers and look at the Status Bar at the bottom of the window. Excel shows the average, count and sum there by default; right-click the status bar to switch on Minimum and Maximum, then the range is simply the difference of two numbers you can read off the screen.
- Add conditional formatting to highlight the actual max and min cells so you can see which values drive the range.
- If the range is huge, the data probably contains an outlier. Consider whether it is real or a data entry error before reporting the figure.
Troubleshooting
The result is 0. Either the minimum and maximum are the same, or the cells are text and only one numeric value is present. Click a suspect cell and check the Number Format dropdown on the Home tab; if it shows Text, convert the column to numbers.
You get #VALUE!. A cell inside the range holds an error value such as #DIV/0! or #N/A, and MAX propagates it. Use =AGGREGATE(4,6,A2:A20)-AGGREGATE(5,6,A2:A20) to ignore errors and hidden rows.
The range looks too large. Check for dates, times, or totals inside the range. Dates are stored as whole numbers, so a date like 1 Jan 2025 appears as a large number and can dominate MAX. Format the column as general or examine the MAX cell to see the culprit.
The formula will not calculate. Make sure Calculation Options is set to Automatic on the Formulas tab. If it is set to Manual, press F9 to recalculate.
You copied the formula and the results changed unexpectedly. That is the relative reference shifting. Undo with Ctrl+Z, add dollar signs with F4, and copy again.
Frequently Asked Questions
Does Excel have a single RANGE function?
No. There is no built-in function called RANGE. You calculate it as =MAX(range)-MIN(range).
Does the formula ignore blank cells?
Yes. MAX and MIN ignore blanks and text, but they do not ignore zero, so a cell containing 0 counts as a real value.
Can I calculate the range of non-adjacent cells?
Yes. List each cell or block separated by commas inside the same function, for example =MAX(A2,B5,D8:D20)-MIN(A2,B5,D8:D20).
How do I find the range of a filtered list?
MAX and MIN see all rows, hidden or not. For visible rows only, use SUBTOTAL with its visible-only MAX and MIN function numbers, or use a helper column that flags visible rows.
What is the difference between range and standard deviation?
Range is simply the spread between the highest and lowest values. Standard deviation, from the function STDEV.S, measures how spread out the values are around the mean and is less sensitive to a single outlier.
Does range work on text or categories?
No. Range is a numeric measure. For text data, use counts such as COUNTIF instead.