Normally, when I use the word range in my tutorials about Excel, it’s a reference to a cell or a collection of cells in the worksheet.
But this tutorial is not about that range.
A ‘Range’ is also a mathematical term that refers to the range in a data set (i.e., the range between the minimum and the maximum value in a given dataset)
In this tutorial, I will show you really simple ways to calculate the range in Excel.
What is a Range?
In a given data set, the range of that data set would be the spread of values in that data set.
To give you a simple example, if you have a data set of student scores where the minimum score is 15 and the maximum score is 98, then the spread of this data set (also called the range of this data set) would be 73
Range = 98 – 15
‘Range’ is nothing but the difference between the maximum and the minimum value of that data set.
How to Calculate Range in Excel?
If you have a list of sorted values, you just have to subtract the first value from the last value (assuming that the sorting is in the ascending order).
But in most cases, you would have a random data set where it’s not already sorted.
Finding the range in such a data set is quite straightforward as well.
Excel has the functions to find out the maximum and the minimum value from a range (the MAX and the MIN function).
Suppose you have a data set as shown below, and you want to calculate the range for the data in column B.
Below is the formula to calculate the range for this data set:
=MAX(B2:B11)-MIN(B2:B11)
The above formula finds the maximum and the minimum value and gives us the difference.
Quite straightforward… isn’t it?
Calculate Conditional Range in Excel
In most practical cases, finding the range would not be as simple as just subtracting the minimum value from the maximum value
In real-life scenarios, you might also need to account for some conditions or outliers.
For example, you may have a data set where all the values are below 100, but there is one value that is above 500.
If you calculate arrange for this data set, it would lead to you making misleading interpretations of the data.
Thankfully, Excel has many conditional formulas that can help you sort out some of the anomalies.
Below I have a data set where I need to find the range for the sales values in column B.
If you look closely at this data, you would notice that there are two stores where the values are quite low (Store 1 and Store 3).
This could be because these are new stores or there were some external factors that impacted the sales for these specific stores.
While calculating the range for this data set, it might make sense to exclude these newer stores and only consider stores where there are substantial sales.
In this example, let’s say I want to ignore all those stores where the sales value is less than 20,000.
Below is the formula that would find the range with the condition:
=MAX(B2:B11)-MINIFS(B2:B11,B2:B11,">20000")
In the above formula, instead of using the MIN function, I have used the MINIFS function (it’s a new function in Excel 2019 and Microsoft 365).
This function finds the minimum value if the criteria mentioned in it are met. In the above formula, I specified the criteria to be any value that is more than 20,000.
So, the MINIFS function goes through the entire data set, but only considers those values that are more than 20,000 while calculating the minimum value.
This makes sure that values lower than 20,000 are ignored and the minimum value is always more than 20,000 (hence ignoring the outliers).
Note that the MINIFS is a new function in Excel is available only in Excel 2019 and Microsoft 365 subscription. If you’re using prior versions, you would not have this function (and can use the formula covered later in this tutorial)
If you don’t have the MINIF function in your Excel, use the below formula that uses a combination of IF function and MIN function to do the same:
=MAX(B2:B11)-MIN(IF(B2:B11>20000,B2:B11))
Just like I have used the conditional MINIFS function, you can also use the MAXIFS function if you want to avoid data points that are outliers in the other direction (i.e., a couple of large data points that can skew the data)
So, this is how you can quickly find the range in Excel using a couple of simple formulas.
I hope you found this tutorial useful.
Other Excel tutorials you may like:
- How to Calculate Standard Deviation in Excel
- How to Calculate Square Root in Excel
- How to Calculate and Format Percentages in Excel
-
Select the cell where you want the result to appear.
-
On the Formulas tab, click More Functions, point to Statistical, and then click one of the following functions:
-
COUNTA: To count cells that are not empty
-
COUNT: To count cells that contain numbers.
-
COUNTBLANK: To count cells that are blank.
-
COUNTIF: To count cells that meets a specified criteria.
Tip: To enter more than one criterion, use the COUNTIFS function instead.
-
-
Select the range of cells that you want, and then press RETURN.
-
Select the cell where you want the result to appear.
-
On the Formulas tab, click Insert, point to Statistical, and then click one of the following functions:
-
COUNTA: To count cells that are not empty
-
COUNT: To count cells that contain numbers.
-
COUNTBLANK: To count cells that are blank.
-
COUNTIF: To count cells that meets a specified criteria.
Tip: To enter more than one criterion, use the COUNTIFS function instead.
-
-
Select the range of cells that you want, and then press RETURN.
We usually require certain metrics to understand the data that we are working with. There are a number of such representative metrics, like the average, the median, etc. Among these metrics, an often-used value is the ‘Range’.
In this tutorial, we will show you two easy ways in which you can find the range of a series of numbers in Excel:
- Using a formula with the MIN and MAX built-in functions
- Using a formula with the SMALL and LARGE built-in functions
What is Range and How is it Calculated?
The range is a measure of the spread of values in a series. In other words, it is the variation between the upper and lower limits of the series on a particular scale.
To find the range of a set of numbers, you need to find the difference between the largest and smallest numbers.
For example, if you have a series of numbers {4,2,6,5,3} then the range can be calculated as follows:
Range = largest value - smallest value
= 6 – 2
Calculation of the range is a very simple process, requiring three basic arithmetic operations:
- Finding the largest value
- Finding the smallest value
- Finding the difference between the two
Given below are two methods to quickly calculate the range of a set of numbers in Excel. To demonstrate both methods, we will use the following dataset:
Finding the Range in Excel with MIN and MAX Functions
The first way to find the range is to use a combination of the MIN and MAX functions.
The MIN Function
The Excel MIN function returns the smallest numeric value in a range of values. The syntax for the MIN function is as follows:
=MIN (number1, [number2], ...)
Here,
- number1 can be a numeric value, a reference to a numeric value, or a range of numeric values.
- number2,… is optional. It can be a numeric value, a reference to a numeric value, or a range of numeric values.
For example, to find the minimum value of numbers in the range B2:B7, you will write the MIN function as follows:
=MIN(B2:B7)
The MAX Function
The Excel MAX function returns the largest numeric value in a range of values. The syntax for the MAX function is as follows:
=MAX (number1, [number2], ...)
Here,
- number1 can be a numeric value, a reference to a numeric value, or a range of numeric values.
- number2, … is optional. It can be a numeric value, a reference to a numeric value, or a range of numeric values.
For example, to find the maximum value of numbers in the range B2:B7, you will write the MAX function as follows:
=MAX(B2:B7)
Note: Both MIN and MAX functions ignore empty cells, logical values like TRUE and FALSE, as well as text values.
Using the MIN and MAX functions to Find the Range of A Series
To find the range of values in the given dataset, we can use the MIN and MAX functions as follows:
- Select the cell where you want to display the range (B8 in our example).
- Type in the formula: =MAX(B2:B7)-MIN(B2:B7)
- Press the Return key.
Note: You can replace the reference B2:B7 with reference to the cells containing the values you want to calculate the range for.
Explanation of the Formula
The formula simply performed the basic steps required to calculate the range:
- Finding the largest value: =MAX(B2:B7)
- Finding the smallest value: =MIN(B2:B7)
- Finding the difference between the two: =MAX(B2:B7) – MIN(B2:B7)
Finding the Range in Excel with SMALL and LARGE Functions
The second way to find the range is to use a combination of the SMALL and LARGE function.
The SMALL Function
The Excel SMALL function returns the ‘n-th smallest value’ in a range of values. So you can use it to find the 1st smallest value, 2nd smallest value, 3rd smallest value, and so on.
The syntax for the SMALL function is as follows:
=SMALL (array, n)
Here,
- array is the range of cells that you want to find the n-th smallest value from.
- n is an integer that specifies the position from the smallest value, i.e. the nth position.
For example, to find the 3rd smallest value in the range B2:B7, you will write the SMALL function as follows:
=SMALL(B2:B7,3)
Similarly, to find the smallest value in the range B2:B7, you will write the function as follows:
=SMALL(B2:B7, 1)
Notice the above function gives a result equivalent to the function:
=MIN(A2:A7)
The LARGE Function
The Excel LARGE function returns the ‘n-th largest value’ in a range of values. So you can use it to find the 1st largest value, 2nd largest value, 3rd largest value and so on.
The syntax for the LARGE function is as follows:
= LARGE (array, n)
Here,
- array is the range of cells that you want to find the n-th largest value from.
- n is an integer that specifies the position from the largest value, i.e. the nth position.
For example, to find the 3rd largest value in the range B2:B7, you will write the LARGE function as follows:
= LARGE (B2:B7,3)
Similarly, to find the largest value in the range B2:B7, you will write the function as follows:
= LARGE (B2:B7, 1)
Notice the above function gives a result equivalent to the function:
=MAX(B2:B7)
Note: In cases where you’re working with large volumes of data, using the MIN and MAX functions are more efficient to use than the SMALL and LARGE. This is because the SMALL and LARGE functions require more computing and resources.
Using the SMALL and LARGE functions to Find the Range of A Series
To find the range of values in the given dataset, we can use the SMALL and LARGE functions as follows:
- Select the cell where you want to display the range (B8 in our example).
- Type in the formula: =LARGE(B2:B7,1) – SMALL(B2:B7,1)
- Press the Return key.
Note: You can replace the reference B2:B7 with reference to the cells containing the values you want to calculate the range for.
Explanation of the Formula
The formula simply performed the basic steps required to calculate the range:
- Finding the largest value: = LARGE(B2:B7,1)
- Finding the smallest value: = SMALL(B2:B7,1)
- Finding the difference between the two: =LARGE(B2:B7,1)-SMALL(B2:B7,1)
Applications and Limitations of the Range
The range provides a great way for us to get a basic understanding of how spread out the numbers in the dataset are.
So, a higher range value means the data is quite spread out, while a smaller range value means the data is less spread out, or more concentrated.
It must be noted, though, that the range is a very crude measurement since it is quite sensitive to outliers.
A single value that is too high or too low can completely alter the range, giving an erroneous representation of the data. As such, it doesn’t always provide a true indication of the spread in the dataset.
Having said that, the range is easy to calculate. It only requires basic operations. So, it is a good way to help you get a very basic understanding of the nature of your data.
Other Excel tutorials you may also like:
- How to Calculate Standard Error In Excel
- How to Square a Number in Excel
- How to Use Pi (π) in Excel
- How to Calculate Antilog in Excel
- How to Use e in Excel | Euler’s Number in Excel
- How to Find Outliers in Excel
- How to Find Slope in Excel (Easy Formula)
- How to Find Percentile in Excel (PERCENTILE Function)
Excel Function for Range (Table of Content)
- Excel Function for Range
- Examples of Range Function in Excel
Range Function in Excel
Range in Excel is the difference between the maximum limit and minimum limit of the available numbers in excel. For example, we have around 10 different number of randomly selected in a list in Excel. To calculate the Range for these numbers, we need to find the upper and lower values using the MAX and MIN function in the list of those cells. Once we get the maximum and minimum values out of those numbers, then subtract the Max value from the Min value. The returned number will be the range.
There are two kinds of ranges used extensively in excel, which are illustrated below:
Symmetrical Range: A range which consists of all cells in adjacent positions to each other. Such a range usually shows up as a square or rectangle in a spreadsheet when highlighted. The range shown in the image would be (A1:C4)
Irregular Range: A range consisting of cells that are not contiguous and may not have regular geometrical shapes when highlighted. The range highlighted in the image would be (A1:C4, E1,E4, B6,A7)
Examples of Range Function in Excel
Now, a range in itself would not be useful as we have to derive insights from the range’s data. So formulae are used with cell ranges which add the operation we want to perform in the data from the range. For example, if we want to find the sum of the numbers in cells A1 till C4, .we would use =SUM(A1:C4)
You can download this Excel Function for Range Template here – Excel Function for Range Template
Example #1 – Finding Maximum and Minimum
1) Finding the maximum and minimum values in a cell range: We use the following functions when we are looking for minimum and maximum values in a cell range. Please note that this would give us the mathematical result and not the maximum and minimum as defined by cell number.
- For Maximum: We would use the =MAX(Cell Range) function as illustrated below.
- For Minimum: We would use the =MIN(Cell Range) function as shown below.
2) Suppose we are not interested just in the minimum and maximum in the highlighted range, but also in the top and bottom k numbers in the range. We can use the following functions to calculate those.
- For the top k number, say k=3, which means the third-largest number in the range, we would use the function =LARGE(Cell Array,k) for symmetrical ranges or =LARGE((Cell Range),k) for irregular ranges as shown below.
- A very similar function for finding the kth smallest number in a range would be to use =SMALL(Cell Array, k) for a symmetrical range or =SMALL((Cell Range),k) for an irregular range.
Example #2 – How to Define and Use Ranges in Excel?
We will now look at how to define and use ranges in excel. First, we need to have data to work with. This can be anything in a spreadsheet ranging from letters to numbers or a combination of both. For the illustrations accompanying this discussion, I am using a sample from a production database which stores data on how many parts are produced in a year.
Let us say we want to know the range of production numbers that have been entered over the two years. We do this by subtracting the minimum from the maximum value. For this, we need not find each value individually but have to breakdown the calculation steps and write the formula as follows:
MAX(Cell Range)-MIN(Cell Range)
Please note that the cell range has to be the same in the arguments; otherwise, the formula would not return the correct result.
We find that the range of production is 368 parts. Now, if we want to find out the occurrence of a particular value in the range, or a range of values within the range, we use another function called COUNTIF. This function has the following syntax:
COUNTIF(Range, value)
Let us suppose we want to find what was month in which we hit more than 300 parts. The formula would be =COUNTIF(C2:C23,”>300″)
We find that for 7 months, the production was more than 300 parts. We can also find out if we had any month which was below a particular number, suppose 100. We would use a nested COUNTIF formula within an IF statement to get a Yes or No answer like this:
=IF(COUNTIF(range,” value”),” Yes”,” No”)
This would look like this:
The result would be a No as none of the production numbers in the range is below 100. A variation of this can be used to find if we have any production number in a particular value. This would be as follows:
COUNTIF(range,”*”&value&”*”) or COUNTIF(range, value)
The first variation is useful if we want to match two different databases, and the second when we want to find out if a particular value occurs or not, and if it does, then how many times it reoccurs.
We can use the MATCH function instead of COUNTIF in case we want to find the number of values greater or less than a given value.
In the above example, we use the MATCH function to find the number of months that had less than 300 parts produced.
Things to Remember
- We should sort the data in ascending or descending order wherever feasible to simplify operations when using ranges.
- Quotation marks (“”) and asterisk(*) are used in formulae whenever we are looking for substrings or specific text ranges within a range.
- Irregular ranges are the most common ranges used in business. As such, whenever possible, we should use tables to classify the data before running any operations on them.
- It must be noted that ranges can be highlighted manually, and Excel displays the number of cells in it as a count at the bottom; however, we can find out the number of rows or columns in a range using the following functions:
ROWS(range)
COLUMNS(range)
Usually, these two functions are not required but are useful for large tables and multiple databases and for recording macros.
Conclusion
Knowledge of range in excel is an important pre-requisite to being able to manipulate data. The range is also used in recording macros and VBA coding, and hence an in-depth understanding of range is a must for anyone using excel.
Recommended Articles
This is a guide to Excel Function for Range. Here we have discussed Examples of Range Function in Excel along with steps and a downloadable excel template. You may also look at the following articles to learn more –
- VBA Range
- VBA Selecting Range
- Excel Named Range
- Range in Excel
Maintenance Alert: Saturday, April 15th, 7:00pm-9:00pm CT. During this time, the shopping cart and information requests will be unavailable.
Categories: Advanced Excel
Tags: Excel Range Formula
An essential skill any Excel user should know is how to determine the range of values in Excel. Most businesses don’t have time to waste sorting through rows and rows in Excel in order to find the highest and lowest values of revenue, sales, or other information. The difference between the highest and lowest figures in a group of data – the range – can be valuable in accurate decision making, budgeting, and forecasting.
Let’s pretend you are the purchasing manager for Revelation, Inc., a small business that distributes computers. You can bid bulk pricing for raw materials that will significantly improve Revelation’s profits. The sooner you can purchase materials, the better, because the price increases the closer they are to the ship date. You can use sales data from the prior fiscal year to budget for raw materials, and the range can help you forecast next year’s sales based on this year’s results. You can use the average sales per month for insight into what raw materials you should need when. Identifying that specific gap is also great for setting performance standards, because you can figure out how you perform against other months.
Because Excel offers multiple ways to write range formulas to suit your individual needs, here are three range formula options to get you started!
1. Minimum and Maximum Formulas
Revelation keeps a spreadsheet with information including the state, model, number of units, unit price, and total revenue for each product per state. The past year’s product sales are arranged as follows:
You need to find which products have the smallest and largest demand. This is a small list, but if you sell or resell a lot of product, the following formula can be invaluable. You can find minimum and maximum units easily with the MIN() and MAX() functions.
- In cell B15, type “=MIN(C2:C13)”.
- In cell B16, type “=MAX(C2:C13)”.
You now have a quick report of the fewest number of units sold in a state (102 tablets in Iowa) and the most sold (450 laptops in Illinois).
2. Top k and Bottom k Formulas
Suppose you’re interested in more data – not just the lowest selling item but the three lowest. You can find these with the SMALL() function. To use SMALL(), you’ll need two parameters:
- The same range or list of values as you used for MIN().
Note: If you are using multiple values instead of a single continuous range, you’ll need to place each set in parentheses.
- The value k, which is the desired position from the bottom of the list. If you’re looking for the smallest value, then k = 1. To find the second smallest value, k = 2, etc.
To find the largest three values, use the LARGE() function with the same parameters as SMALL().
Note that SMALL() with k = 1 produces exactly the same result as MIN(). Similarly, LARGE() with k = 1 yields the same as MAX().
3. Conditional Minimum and Maximum Formulas
In some situations, you might need a minimum value that meets specific criteria. For example, you might want to know the fewest units sold for the spring quarter duration or for a specific product type.
Excel provides SUMIF(), COUNTIF(), and other helpful conditional formulas. Unfortunately, there is no MINIF() or MAXIF(), but you can create the same effect with a slightly more complicated method called an array formula. An array formula evaluates a range of cells instead of a single cell.
Typically an IF() formula tests the truth value of a single cell, but as an array formula, we can force it to evaluate each cell in a range. With an array formula you will get an error if you just press enter – #VALUE!. Remember to press CTRL, SHIFT, and ENTER after you finish your array formula.
Let’s find the minimum value for desktops. First, type the matching value (desktop) into the cell you compare your function to. If you are looking for desktop values, then type “desktop” in B18. The formula below will compare that cell reference to the range you are testing. Nest the MIN() and IF() statements as follows: “=MIN(IF(B2:B13=B18,C2:C13))” and press <CTRL>-<SHIFT>-<ENTER>.
The three formulas in rows 18, 19, and 20 calculate the minimum numbers of desktops, laptops, and tablets sold. You can write identical formulas with MAX() to find the greatest number of each product sold.
Next Steps
Now you can use three different methods (Minimum and Maximum Formulas, Top k and Bottom k Formulas, Conditional Minimum and Maximum Formulas) to find the range of values in any data set.
PRYOR+ 7-DAYS OF FREE TRAINING
Courses in Customer Service, Excel, HR, Leadership,
OSHA and more. No credit card. No commitment. Individuals and teams.
Range is the difference between minimum and maximum value in a dataset. In Excel you can calculate range using the functions MIN and MAX.
For example, if you have your data in cells A1 to A15, you can calculate range in a single formula:
=MAX(A1:15)-MIN(A1:A15)
The first part of the formula, MAX(A1:A15)
, finds the highest value in the data (75 in the screenshot above).
The second part, MIN(A1:15)
, finds the lowest value (14).
If you subtract the minimum from the maximum, you get range (61).
Calculating Range in Excel VBA
Range is so commonly needed, it is surprising there is no built-in RANGE function in Excel, which would make the calculation easier than the formula above. We could just use a formula like this:
=RANGE(A1:A15)
Unfortunately, there is no built-in RANGE function in Excel.
However, with some basic VBA, we can create our own custom function that would work just like that.
Function Range(Data) ' Calculates range (maximum - minimum) of data Range = Application.WorksheetFunction.Max(Data) _ - Application.WorksheetFunction.Min(Data) End Function
With this function defined in VBA, we can now use it in a spreadsheet to calculate range more simply:
=RANGE(A1:A15)
This gives the same result as
=MAX(A1:15)-MIN(A1:A15)
Note: Although «range» means a different, very common thing in Excel and VBA – a range of cells – it is not a reserved word in VBA and you can call your custom function RANGE. That said, you may want to consider another name to avoid any confusion, such as RNG.
Calculating Trading Range in Excel
In the financial markets, range is the difference between highest and lowest price (high and low) in a particular time period, such as a trading day. As above, it is calculated by subtracting the minimum (low) from the maximum (high):
Range = High – Low
If you have market data in the OHLC (open-high-low-close) format in Excel, simply take the cell containing the high and subtract the cell containing the low from it – see screenshot from ATR Calculator below.
Unlike most other market statistics and technical indicators, closing price does not enter the calculation of range in any way.
Calculating Range in ATR Calculator
You can calculate average range in the ATR Calculator by selecting «Range» in the drop-down box in cells K4/L4/M4. You can also see the range for each bar in column G.
Average True Range (ATR)
Average True Range (ATR) is a more advanced concept of range and more suitable in some types of markets. While the traditional (high minus low) range only considers the volatility (range) of the trading session itself, ATR also looks at overnight volatility (a possible price gap from the previous day’s close to the current day’s opening price).
Here you can see a detailed explanation of true range and ATR calculation.
A data range in Excel is simply a collection of two or more cells; the cells are not required to be next to each other.
Figure 1. Cell Range in Excel
Generic Formula
=RANGE(max value-min value)
- Max value = Largest number value in the selected range
- Min value = Smallest number value in the selected range
We can select a cell range in Excel by holding down the CTRL keyboard key and then clicking on each individual cell that we want to be included in the range. The data range in Excel of a particular set of data gives us a simple idea of the distribution of values that it contains.
How to Calculate Range in Excel
Finding Range in Excel is a simple task which requires us to subtract the Minimum value of numbers contained in the selected cells from the Maximum value.
Here’s how to calculate range in Excel;
- We begin by finding the MAX value of a set of data in our worksheet;
Figure 2. Data Values in Excel
To determine the MAX value for the data set above we will use the MAX Function in Excel.
- The MAX formula we will enter into cell B9 of our worksheet example is as follows;
=MAX(A1:B7)
Figure 3. MAX Value in Excel
The range function in Excel returned the MAX value in the selected range of data above (A1:B7), as103.
- Next, we have to determine the MIN value in our data set.
The MIN formula we will enter into cell B9 of our worksheet example is as follows;
=MIN(A1:B7)
Figure 4. MIN Value in Excel
The range function in Excel returned the MIN value in the selected range of data above (A1:B7), as 2.
Since we now know how to use the range function in Excel to calculate MAX and MIN values, let us now demonstrate how to find the range in Excel by subtracting the MIN value from the MAX value in the following data set;
Figure 5. Data Set in Excel
- The Excel range formula we will enter into cell B9 of our worksheet example is as follows;
=MAX(C2:C7)-MIN(C2-C7)
Figure 6. Finding Range in Excel
The Excel range function returned 529 as the total range value after subtracting the MIN value from the MAX value in the data set above.
Instant Connection to an Excel Expert
Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.