Excel: PivotTable with the median function

Excel: PivotTable with the median function

PivotTables do not allow median function. We will create a helper column and use an array function to calculate the median in a PivotTable. Also shown are average, median, averageif, if statement with the median function.

The median function finds the middle number in a range. If you have an odd number of numbers (3, 7, 15 numbers) it will find the middle number. If you have an even number of numbers, (2, 14, 28) if will find the two middle numbers and average them.

Functions used in the video above

  1. Average – Returns the average (arithmetic mean) of the arguments. For example, if the range A1:A20 contains numbers, the formula =AVERAGE(A1:A20) returns the average of those numbers.
  2. Median – Returns the statistical median (the middle value) of a list of supplied numbers.
  3. If
  4. Array Function
  5. AverageIf – returns the average (arithmetic mean) of all numbers in a range of cells, based on a given criterion. The AVERAGEIF function is a built-in function in Excel that is categorized as a Statistical Function.

There is no medianif function so we nested the median function with an if statement and made it an array function.

Chris Menard

Chris trains corporate clients in Microsoft Office Excel, PowerPoint, Word, and Outlook. When he's not training, he blogs about technology and creates training videos on YouTube. Chris currently has over 240 technology videos available, most of which have been created following questions asked during Microsoft Office training sessions.

Categories