Applies To„Excel“, skirta „Microsoft 365“, skirtam „Mac“ „Excel 2024“, skirta „Mac“ „Excel 2021“ skirta „Mac“

Excel provides a variety of ways to find the average of a set of numbers. For example, you can use function to calculate a simple average, a weighted average, or an average that excludes specific values.

Use the provided sample data and the following procedures to learn how to calculate averages.

Copy the sample data

To better understand the steps, copy the following sample data to cell A1 on a blank sheet.

  1. Create a blank workbook or sheet.

  2. Select the following sample data.

    Note: Do not select the row or column headings (1, 2, 3...  A, B, C...) when you copy the sample data to a blank sheet.

    Selecting sample data in Help

    Select sample data

    Unit Quality

    Price Per Unit

    Number of Units Ordered

    10

    35

    500

    7

    25

    750

    9

    30

    200

    10

    40

    300

    8

    27

    400

    5

    20

    200

    Average unit quality

    Average price per unit

    Average quality for all units rated above 5

  3. Press The Command button on macOS.+ C .

  4. In the sheet, select cell A1, and then press The Command button on macOS.+ V .

Calculate the simple average

  1. Select cells A2 through A7 (the values in the Unit Quality column).

  2. On the Formulas tab, click the arrow next to AutoSum  AutoSum button, and then click Average.

    The result is 8.166666667.

Calculate the average for nonadjacent cells

  1. Select the cell where you want the average to appear, such as cell A8, which is the cell to the left of the cell that contains the text "Average unit quality" in the sample data.

  2. On the Formulas tab, click the arrow next to AutoSum  AutoSum button, click Average, and then press RETURN.

  3. Click the cell that contains the average that you just created, cell A8 in this example.

    The formula is displayed in the formula bar, =AVERAGE(A2:A7) if you're using the sample data.

  4. In the Formula Bar, select the content between the parentheses, which is A2:A7 if you're using the sample data.

  5. Hold down the The Command button on macOS. key and click the cells that you want to average, and then press RETURN. For example, select A2, A4, and A7, and then press RETURN.

    Excel replaces the selected range reference in the AVERAGE function with cell references for the cells that you selected. In this example, the result is 8.

Calculate a weighted average

This example calculates the average price paid for a unit across all orders, where each order is for a different number of units at a different price per unit.

  1. Select cell A9, which is the cell to the left of the cell that contains the text "Average price per unit."

  2. On the Formulas tab, click Insert Function to open the Formula Builder pane.

  3. In the Formula Builder list, scroll down and double-click SUMPRODUCT.

    Tip: To quickly find a function, click the Search for a function box, and then start typing the function name. For example, start typing SUMPRODUCT.

  4. Click the box next to array1, and then on the sheet, select cells B2 through B7 (the values in the Price Per Unit column).

  5. Click the box next to array2, and then on the sheet, select cells C2 through C7 (the values in the Number of Units Ordered column).

  6. In the formula bar, click to the right of the closing parenthesis for the formula, and then type /

    If you don't see the formula bar, on the View menu, click Formula Bar.

  7. In the Formula Builder list, double-click SUM.

  8. Select the range in the number1 box, press DELETE, and then on the sheet, select cells C2 through C7 (the values in the Number of Units column).

    The formula bar should now contain the following formula: =SUMPRODUCT(B2:B7,C2:C7)/SUM(C2:C7).

  9. Press RETURN.

    This formula divides the total cost of all the orders by the total number of units ordered, which results in a weighted price per unit average of 29.38297872.

Calculate an average that ignores specific values

You can create a formula that excludes specific values. In this example, you'll create a formula to calculate the average unit quality for all units that have a rating greater than 5.

  1. Select cell A10, which is the cell to the left of the cell that contains the text "Average quality for all units rated above 5."

  2. On the Formulas tab, click Insert Function to open the Formula Builder pane.

  3. In the Formula Builder list, double-click AVERAGEIF.

    Tip: To quickly find a function, click the Search for a function box, and then start typing the function name. For example, start typing AVERAGEIF.

  4. Click the box next to range, and then on the sheet, select cells A2 through A7 (the values in the Price Per Unit column).

  5. Click the box next to criteria, and then type ">5".

  6. Press RETURN.

    The formula excludes the value in cell A7 from the calculation, and results in an average unit quality of 8.8.

    Tip: To use the AVERAGEIF function to calculate an average that excludes zero values in a list of numbers, type "<>0" in the box next to criteria.

See also

Calculate a running total

Calculate percentages

AVERAGE function

Reikia daugiau pagalbos?

Norite daugiau parinkčių?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.