How to Calculate Average of Multiple Ranges in Excel (3 Methods)

Our sample dataset contains player names and their scores in different games. We’ll use this data to practice calculating the average of specific scores across multiple ranges.

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel


Method 1 – Use the Excel AVERAGE Function to Calculate the Average of Multiple Non-Adjacent Ranges Counting Zero

In Excel, the AVERAGE function computes the average of a set of values, a set of ranges. Sometimes, the numbers are non-adjacent and we have to calculate the values rapidly. Let’s start with a basic understanding of the AVERAGE function in Excel.

Syntax:

The syntax for the AVERAGE function is:

AVERAGE(number1, [number2], …)

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

Arguments:

number1: [required] The first integer, cell reference, or range for which the average should be calculated.

number2: [optional] Up to 255 more numbers, cell references, or ranges for which the average should be calculated.

Return Value:

The arithmetic mean of the parameters.


1.1. Add the Ranges to the AVERAGE Function One by One

STEPS:

  • Select the cell where we want the average of the multiple ranges (e.g., D12).
  • Type the formula below. We want the average of ranges C5:C9, D5:D7, and E5:E9, inside the AVERAGE function. Select all the ranges that we wish to average, by pressing Ctrl and dragging over the ranges.
=AVERAGE(C5:C9,D5:D7,E5:E9)
  • Press Enter.

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

  • The average is output in cell D12. The formula will be shown in the formula bar.

The above result is for non-contiguous ranges, including zero.

Read More: How to Calculate Average of Multiple Columns in Excel


1.2. Give Range Name to Multiple Ranges

STEPS:

  • Select the ranges C5:C9, D5:D7, and E5:E9 while holding the Ctrl key.
  • Give a name to the selected ranges. E.g., Score.
  • Choose the cell where you want the average of the multiple ranges to be calculated. E.g., D12.
  • Type the formula below.
=AVERAGE(Score)
  • Press the Enter key.
  • The average will show in cell D12.

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

The above result is the average of multiple non-contiguous ranges including zero.


Method 2 – Apply Excel Formula to Determine Average of Multiple Non-Adjacent Ranges Except Zero

This method uses a combination of SUM, INDEX, and FREQUENCY functions to calculate the average of multiple ranges excluding zero.

2.1. Average Ranges One by One in Excel Formula

STEPS:

  • Select cell D12.
  • Enter the formula below.
=SUM(C5:C9,D5:D7,E5:E9)/INDEX(FREQUENCY((C5:C9,D5:D7,E5:E9),0),2)

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

  • Press the Enter.
  • Cell D12 shows the result.

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

How Does the Formula Work?

  • SUM(C5:C9,D5:D7,E5:E9): The SUM function adds up the ranges C5:C9, D5:D7, and E5:E9 and returns the total of the selected multiple ranges.
    Output → 788
  • FREQUENCY((C5:C9,D5:D7,E5:E9),0): The FREQUENCY function returns a vertical array of integers after calculating how often values occur within a range of values. FREQUENCY(C5:C9,D5:D7,E5:E9) becomes FREQUENCY(C5:C9,D5:D7,E5:E9), which locks the reference to a certain cell. Then, FREQUENCY((C5:C9,D5:D7,E5:E9),0) returns a vertical array.
    Output → 1
  • INDEX(FREQUENCY((C5:C9,D5:D7,E5:E9),0),2): The INDEX function returns the value at a certain point in a range or array. It becomes INDEX({1;12},2). That means it returns the result at that location in a range. By omitting zero we have 12 cells.
    Output → 12
  • SUM(C5:C9,D5:D7,E5:E9)/INDEX(FREQUENCY((C5:C9,D5:D7,E5:E9),0),2): This returns the average of multiple ranges. It becomes 788/{12} and returns the average of ranges.
    Output → 65.67

Read More: How to Calculate Average in Excel Excluding 0


2.2. Give the Multiple Range a Name

STEPS:

  • Similar to section 1.2, select and name the ranges C5:C9, D5:D7, and E5:E9 (e.g., “Scores”).

3 Appropriate Methods to Calculate Average of Multiple Ranges in Excel

  • Select the cell where the average of the several ranges will be calculated. E.g., D12.
  • Type the following formula.
=SUM(Scores)/INDEX(FREQUENCY((Scores),0),2)
  • Press Enter.


Method 3 – Excel VBA to Calculate Average of Multiple Ranges

STEPS:

  • Go to the Developer tab on the ribbon.
  • Click on Visual Basic or press Alt + F11 to open the Visual Basic Editor.

Excel VBA to Calculate Average of Multiple Ranges

  • Another way to open the Visual Basic Editor is to right-click on the sheet and select View Code.

  • Enter the VBA code to calculate the average of multiple ranges. This code is based on the built-in VBA Average function. With this, we can average as many ranges of cells as we want.

VBA Code:

Sub Average_Multiple_Ranges()
    Dim s As Worksheet
    Set s = Worksheets("VBA")
    s.Range("F5") = Application.WorksheetFunction.Average(s.Range("C:D"))
End Sub
  • Run the code by pressing F5 or clicking the Run Sub button.

Excel VBA to Calculate Average of Multiple Ranges

  • The output result will be the average of multiple ranges in Excel.

Excel VBA to Calculate Average of Multiple Ranges


Download Practice Workbook


Related Articles


<< Go Back to Calculate Average in Excel | How to Calculate in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sabrina Ayon
Sabrina Ayon

Sabrina Ayon, a Computer Science and Engineering graduate from United International University, has been an integral part of the ExcelDemy project for two years. She authored 150+ articles, excelling in instructing through visually engaging Excel tutorials. With a passion for teaching, Sabrina conducted sessions on Excel VBA, sharing her knowledge and insights with others. Currently holding the position of Project Manager for the ExcelDemy Visual Development Project, she oversees various aspects of the project, ensuring its smooth operation... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo