The List.Average function in Power Query gives you the average (the arithmetic mean) of the values in a list. It skips null values, so a blank cell is left out of the average instead of being counted as a zero.
Once you can turn a column, a row, or a group of rows into a list, List.Average covers column averages, row averages, AVERAGEIF-style averages, and averages for each group.
Follow along with the example file
List.Average Function Examples.xlsx
List.Average Function Syntax
List.Average(list as list, optional precision as nullable number) as any
- list – the list of values you want to average. It can be a list you type in curly brackets, such as
{10,20,30}, or a column of a table. - precision (optional) – how precisely the numbers are added before dividing. Leave it out for the default (
Precision.Double), or usePrecision.Decimalwhen tiny rounding errors matter (Example 9 shows when).
What it returns: The average of the non-null values in the list, in the same data type as those values. It works with numbers, dates, times, datetimes, datetimezones, and durations, and it returns null when the list is empty.
The List.Average function is part of the Power Query M language, so it works wherever Power Query does in Excel: Excel 365, 2024, 2021, 2019, and 2016 for Windows, and Excel for Microsoft 365 on Mac.
When to Use the List.Average Function
Use this function when you need to:
- Get the average of a column as a single value
- Add a row average across several columns, leaving blank cells out
- Average across columns while counting blank cells as zero
- Average only the rows that meet a condition, like the AVERAGEIF function in Excel
- Get an average for each group (each region, team, or product) with Table.Group
- Compare each row with the overall average
- Find the average time something takes
Example 1: Average a List of Numbers
Let’s start with the simplest use. Suppose a student scored 78, 85, 92, 88, and 74 in five tests, and you want the average score.
In Excel, go to Data > Get Data > From Other Sources > Blank Query. In the Power Query Editor that opens, type this formula in the formula bar:
= List.Average({78,85,92,88,74})
Result: 83.4

Here, the curly brackets create a list of five numbers. List.Average adds them up (417, the same total the List.Sum function gives) and divides by the count (5) to give 83.4.
In real work, you’ll rarely type the numbers yourself. The rest of the examples are about getting that list out of your data.
In the example file, Examples 1 and 9 type their values right into the query, so they don’t have a sheet. You can open them from Data > Queries & Connections.
Example 2: Get the Average of a Column
Here’s the most common use of List.Average. Below is a support ticket log in an Excel Table named SupportTickets, and I want the average of the Hours to Resolve column as a single number.

In the code below, the Source line uses the Excel.CurrentWorkbook function to pull the SupportTickets table into Power Query by its name.
If you try this on your own data, format it as a table (Ctrl + T) and put your table’s name in place of “SupportTickets”.
Create a new blank query (as in Example 1), open the Advanced Editor (Home > Advanced Editor), and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="SupportTickets"]}[Content],
AverageHours = List.Average(Source[Hours to Resolve])
in
AverageHours
Result: 6

Here, Source is the name of the first step, and it holds the SupportTickets table. Source[Hours to Resolve] takes that column as a list (4, 9, 2.5, 6, 3.5, and 11), and List.Average returns its average, 6.
So whenever you want a column average, put the step name, followed by the column name in square brackets, inside List.Average. The column name goes in the same brackets even when it has spaces, as it does here.
If your numbers came in from another system as text (like “4” instead of 4), List.Average gives the error “We cannot apply operator – to types Text and Text.” That’s because it can only average numbers, dates, times, and durations, not text.
So convert the values to numbers first by changing the AverageHours line to List.Average(List.Transform(Source[Hours to Resolve],Number.From)). The List.Transform function runs the Number.From function on each value, which turns “4” into the number 4, and the average is still 6.
Example 3: Average Across Columns in a Row (Blanks Skipped)
Now let’s average across a row instead of down a column. Below is a table named JudgeScores with the scores three judges gave each contestant, and I want each contestant’s average score in a new Average column.

A few cells are blank because a judge missed that round. In Power Query, those blank cells come in as null.
Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="JudgeScores"]}[Content],
#"Added Average" = Table.AddColumn(Source,"Average",each List.Average({[Judge 1],[Judge 2],[Judge 3]}),type number)
in
#"Added Average"
Result: A new Average column (8, 7, 8, 6.5, and 8)

Here, the Table.AddColumn function adds an Average column and runs the formula after each once for every row. For each row, {[Judge 1],[Judge 2],[Judge 3]} builds a list of that row’s three scores, and List.Average averages them.
The type number at the end of Table.AddColumn sets the new Average column’s data type to number.
Mario Anderson has no score from Judge 2, so his list is {6, null, 8}. List.Average skips the null and divides by 2, not 3, so his average is 7 and not 4.67.
Important: Don’t work out the average with plus signs, like ([Judge 1]+[Judge 2]+[Judge 3])/3. In M, adding a null to a number gives null, so Mario Anderson, Andrea Hayes, and Valerie Powell would all get a blank (null) average.
Example 4: Count Blank Cells as Zero in the Average
Sometimes a blank should count as a zero, like a quiz the student never took. Below is a table named QuizScores with each student’s scores (out of 20) in four quizzes, and I want an Average column where a missed quiz counts as 0.

If you use List.Average on these rows as they are, it skips the blanks (as in Example 3). Amber White would get the average of three quizzes, which is higher than she earned across four.
So turn the nulls into zeros first. Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="QuizScores"]}[Content],
#"Added Average" = Table.AddColumn(Source,"Average",each List.Average(List.ReplaceValue({[Quiz 1],[Quiz 2],[Quiz 3],[Quiz 4]},null,0,Replacer.ReplaceValue)),type number)
in
#"Added Average"
Result: A new Average column (17, 11, 9.75, 15, and 12.75)

Here, {[Quiz 1],[Quiz 2],[Quiz 3],[Quiz 4]} builds the list of a student’s four scores. The List.ReplaceValue function then replaces every null in that list with 0, and List.Average averages all four values.
The last argument of List.ReplaceValue, Replacer.ReplaceValue, is required and tells List.ReplaceValue to replace whole values that match (here, null).
Amber White’s list becomes {15, 0, 17, 12}, so her average is 44/4, which is 11. Without the replacement, List.Average would skip the blank and give her 14.67.
Example 5: Average Only the Rows That Meet a Condition (Like AVERAGEIF)
This next one works like the AVERAGEIF function in Excel. Below is a table named HotelReviews with the room type and rating of each guest review, and I want the average rating of the Suite rooms only.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="HotelReviews"]}[Content],
SuiteAverage = List.Average(Table.SelectRows(Source,each [Room Type]="Suite")[Rating])
in
SuiteAverage
Result: 4.25

Here, the Table.SelectRows function keeps only the rows where Room Type is “Suite”. That’s four reviews (R-102, R-103, R-106, and R-108).
[Rating] at the end then takes the Rating column from those four rows as a list, and List.Average averages 5, 4, 5, and 3 to get 4.25.
The text comparison is case-sensitive, so “suite” in lowercase would not match. For more than one condition (like AVERAGEIFS), join them with and, for example each [Room Type]="Suite" and [Rating]>=4.
If no row meets the condition, List.Average gets an empty list and returns null instead of an error.
Follow along with the example file
List.Average Function Examples.xlsx
Example 6: Get the Average for Each Group (Table.Group with List.Average)
This is one of the most common places you’ll use List.Average. Below is a delivery log in a table named Deliveries, with the number of days each order took, and I want the average delivery days for each region in an Average Days column.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="Deliveries"]}[Content],
#"Grouped Rows" = Table.Group(Source,{"Region"},{{"Average Days",each Number.Round(List.Average([Delivery Days]),1),type number}})
in
#"Grouped Rows"
Result: One row per region with its Average Days (North 3, South 5, and East 2.3)

Here, the Table.Group function groups the rows by Region. For each region, [Delivery Days] is the list of days from that region’s rows only, and List.Average averages them.
The East orders took 2, 3, and 2 days, so their average is 2.3333 (and so on). The Number.Round function rounds it to one decimal place, which gives 2.3.
The rounding is optional, so drop Number.Round if you want the full average.
If a region’s average came out to exactly 2.25, Number.Round would give 2.2, because it rounds a value ending in 5 to the nearest even digit.
To round it up to 2.3 instead (like Excel’s ROUND function does), add RoundingMode.AwayFromZero as a third argument to Number.Round.
If you use the Group By button (Home > Group By) with the Average operation, Power Query writes a similar List.Average step for you, just without the rounding.
Example 7: Flag Rows That Are Above or Below the Average
Now let’s use the average inside a calculation. Below is a table named RepSales with each sales rep’s sales for the month, and I want a Status column that says whether each rep is above or below the team average.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="RepSales"]}[Content],
AverageSales = List.Average(Source[Sales]),
#"Added Status" = Table.AddColumn(Source,"Status",each if [Sales]>AverageSales then "Above average" else "Below average",type text)
in
#"Added Status"
Result: A new Status column (Above average for Daniel Howard, Jack Allen, and Anna Evans, and Below average for George Campbell and Sandra Foster)

Here, the AverageSales step works out the team average once, which is 41000. Then for each row, the if part compares that rep’s sales with 41000 and returns “Above average” or “Below average”.
Putting the average in its own step means Power Query works it out once. You could put List.Average(Source[Sales]) inside the each part instead, but then it can be worked out again for every row.
A rep with sales exactly equal to the average would show “Below average” here, because the check is greater than. If that matters for your data, use >= instead of >.
If you want the highest or lowest sales instead of the average, the List.Max and List.Min functions work the same way on the Sales column.
Example 8: Find the Average Time Taken (Durations)
List.Average isn’t only for numbers. Below is a table named RepairJobs with the start and finish time of each repair job, and I want the average time a job takes.

Create a new blank query, open the Advanced Editor, and use this code:
let
Source = Excel.CurrentWorkbook(){[Name="RepairJobs"]}[Content],
#"Added Time Taken" = Table.AddColumn(Source,"Time Taken",each [Finished]-[Started],type duration),
AverageTime = List.Average(#"Added Time Taken"[Time Taken])
in
AverageTime
Result: 0.02:00:00 (2 hours)

Here, the Added Time Taken step subtracts the start time from the finish time for each job.
In Power Query, one datetime minus another gives a duration, so the four jobs took 2 hours 15 minutes, 1 hour 15 minutes, 3 hours, and 1 hour 30 minutes.
List.Average then averages those four durations and returns a duration too. Power Query shows durations as days.hours:minutes:seconds, so 0.02:00:00 means 0 days and 2 hours.
If you need the average as a plain number of hours, wrap it in the Duration.TotalHours function, which gives 2 here. The Duration.TotalDays function works the same way but gives the result in days.
The same thing happens with dates and times. Averaging a list of dates gives you a date, and averaging times of day (like clock-in times) gives you a time.
Example 9: Avoid Tiny Rounding Errors with Precision.Decimal
This last one is about the optional second argument. Suppose three samples weigh 10.1, 20.2, and 30.3 grams, and you want to check that their average is exactly 20.2 grams.
Create a new blank query, open the Advanced Editor, and use this code:
let
Weights = {10.1,20.2,30.3},
Check = #table({"Precision","Matches 20.2?"},{
{"Default",List.Average(Weights)=20.2},
{"Precision.Decimal",List.Average(Weights,Precision.Decimal)=20.2}})
in
Check
Result: A small table where the Default row shows FALSE and the Precision.Decimal row shows TRUE

Here, the #table function builds a two-row table so you can see both checks side by side. The first row averages the weights with the default precision, and the second uses Precision.Decimal.
By default, List.Average works with binary floating-point numbers, which can’t store some decimals like 0.1 exactly. So the default average is 20.200000000000003, which is not equal to 20.2, and the check returns FALSE.
With Precision.Decimal, the numbers are added as exact decimals, so the average is exactly 20.2 and the check returns TRUE. Use it when you compare an average with an exact value.
If you only need the average to display, the default is fine, because the difference disappears once the number is rounded to a few decimals.
Other Excel Articles You May Also Like:
- List.RemoveItems Function in Power Query M
- Record.SelectFields Function in Power Query M
- Table.Profile – Use Table.Profile in Power Query M to summarize every column.
- List.RemoveNulls – Use List.RemoveNulls in Power Query M to drop null values from a list.
- List.NonNullCount – Use List.NonNullCount in Power Query M to count the filled, non-null values in a list.
- Number.IntegerDivide – Use Number.IntegerDivide in Power Query M to divide and drop the remainder.
- Number.RoundUp – Use Number.RoundUp in Power Query M to round numbers up.
- List.AnyTrue – Use List.AnyTrue in Power Query M to check if any value is true.