Quick, clean, and to the point

Max of every nth column

Excel formula: Max of every nth column
Generic formula 

To get the max of every nth column, you can use an array formula based on the MAX, MOD, and COLUMN functions. In the example shown, the formula in M5 is:


Note: this is an array formula and must be entered with control + shift + enter.

How this formula works

This formula uses the MOD and COLUMN functions to filter out values not in nth columns, then runs MAX on the result.

The key is this snippet:


Here, the formula uses the COLUMN function to get a set of "relative" column numbers for the range (explained in detail here) which looks like this:


This array goes into the MOD function as the number argument:


where L5 is the the value to use for "nth". The MOD function returns the remainder for each column number divided by N. So, for example, when N = 3, MOD will return an array like this:


Note that zeros appear for columns 3, 6, 9, etc., corresponding to every 3rd column. This array is compared to zero with the logical expression =0 to force a TRUE when the remainder is zero and a FALSE when not. These values go into the IF function as the logical test. The IF function filters accordingly, so only values in the original range in nth columns make it into the final array. The other values become FALSE.

When n = 3, the final array inside MAX looks like this:


Finally, the MAX function ignores FALSE values and returns the maximum of remaining values, 19.

Max of every other column

If you want to get the max of every other column, just adapt this formula as needed, understanding the formula automatically assigns 1 to the first column in the range. To get the max of EVEN columns, use:


To get the max of ODD columns, use:

Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.