+ Reply to Thread
Results 1 to 9 of 9

SUMPRODUCT using MOD to sum odd columns

  1. #1
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    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. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    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
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: SUMPRODUCT using MOD to sum odd columns

    Perhaps

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

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,595

    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))))
    Ben Van Johnson

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: SUMPRODUCT using MOD to sum odd columns

    May be this

    =SUMPRODUCT('Monthly View'!D4:AA5000*MOD('Monthly View'!D4:AA4,2))
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,595

    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,...
    Last edited by protonLeah; 05-26-2019 at 12:55 AM.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    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. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    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. #9
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sumproduct two different columns
    By nordmann in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2014, 06:16 AM
  2. SUMPRODUCT across several columns
    By BobTheRocker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-12-2011, 06:05 PM
  3. Sumproduct across several columns
    By BobTheRocker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2011, 11:52 AM
  4. Sumproduct across columns
    By damonb in forum Excel General
    Replies: 6
    Last Post: 01-19-2011, 05:37 PM
  5. Excel 2007 : SUMPRODUCT over several columns
    By bkatzman in forum Excel General
    Replies: 15
    Last Post: 02-18-2010, 03:58 PM
  6. Sumproduct columns?
    By m5rcc in forum Excel General
    Replies: 1
    Last Post: 01-20-2009, 05:38 AM
  7. Replies: 9
    Last Post: 09-18-2008, 08:41 PM
  8. [SOLVED] sumproduct of columns
    By DJS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2006, 03:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1