Quick, clean, and to the point

Sum every nth column

Excel formula: Sum every nth column
Generic formula 

To sum every nth column, you can use a formula based on the SUMPRODUCT, MOD, and COLUMN functions.

In the example shown, the formula in L5 is:


At the core, uses SUMPRODUCT to sum values in a row that have been "filtered" using logic based on MOD. The key is this:


This snippet of 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 goes into MOD like so:


where K5 is the value for N in each row. The MOD function returns the remainder for each column number divided by N. So, for example, when N = 3, MOD will return something like this:


Note that the zeros appear for column 3, 6, 9, etc. The formula uses =0 to force a TRUE when the remainder is zero and a FALSE when not, then we use a double-negative (--) to coerce TRUE and FALSE to ones and zeros. That leaves an array like this:


Where 1s now indicate "nth values". This goes into SUMPRODUCT as array1, along with B5:J5 as array2. SUMPRODUCT then does its thing, first multiplying, then summing products of the arrays.

The only values that "survive" multiplication are those where array1 contains 1. In this way, you can think of the logic of array1 "filtering" the values in array2.

Sum every other column

If you want to sum every other column, just adapt this formula as needed, keeping in mind that the formula automatically assigns 1 to the first column in the range. To sum EVEN columns, use:


To sum 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.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.