# SUMPRODUCT using MOD to sum odd columns

1. ## SUMPRODUCT using MOD to sum odd columns

i am using this formula

=SUMPRODUCT('Monthly View'!D4:AA5000*MOD(COLUMN('Monthly View'!D4:AA4),2))

But it only does the even columns, it will not add up the odd columns as i just get all zeros in the Mod part of the formula or the even columns go to 1 not the odd columns

Any help would be appreciated

2. ## Re: SUMPRODUCT using MOD to sum odd columns

Rather than show us a formula that doesnt work, upload a sample workbook and show us what you expect - then we wont need to guess

3. ## Re: SUMPRODUCT using MOD to sum odd columns

Perhaps

=SUMPRODUCT('Monthly View'!D4:AA5000*(MOD(COLUMN('Monthly View'!D4:AA4),2)=0))

4. ## Re: SUMPRODUCT using MOD to sum odd columns

Alternative to MOD(): ISODD or ISEVEN:
=SUMPRODUCT('Monthly View'!\$D\$4:\$AA\$5000*(ISODD(COLUMN('Monthly View'!\$D\$4:\$AA\$4))))

5. ## Re: SUMPRODUCT using MOD to sum odd columns

May be this

=SUMPRODUCT('Monthly View'!D4:AA5000*MOD('Monthly View'!D4:AA4,2))

6. ## Re: SUMPRODUCT using MOD to sum odd columns

@kvsrinivasamurthy:

Note: "SUMPRODUCT using MOD to sum odd columns"
Your formula calculates based on odd VALUES in row 4 cells vs. odd columns, i.e., E,G,...

7. ## Re: SUMPRODUCT using MOD to sum odd columns

UltimateNeo says

But it only does the even columns, it will not add up the odd columns

8. ## Re: SUMPRODUCT using MOD to sum odd columns

@kvsrinivasamurthy

If all of the values in the cells are even then your suggestion will not add up any columns!

Note that the thread title and the question state odd columns, not odd values!

9. ## Re: SUMPRODUCT using MOD to sum odd columns

I tried the formula in a new file and it works =SUMPRODUCT('Monthly View'!D4:AA5000*(MOD(COLUMN('Monthly View'!D4:AA4),2)=0))

thank you

There are currently 1 users browsing this thread. (0 members and 1 guests)