+ Reply to Thread
Results 1 to 4 of 4

Thread: Exclude Zero Value Cells in a Sumproduct Formula calculating every other column

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Exclude Zero Value Cells in a Sumproduct Formula calculating every other column

    Hello, I have a formula question... I am looking to get the sum of a row, excluding every other column. I'm currently working with the following formula, but need to also exclude zero values, as I get an #Div/0! if a cell is unused or of zero value. PLEASE HELP!!!

    =SUMPRODUCT((MOD(COLUMN(B12:CK12),2)*B12:CK12)*(B12:CK12>0),B12:CK12)

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Exclude Zero Value Cells in a Sumproduct Formula calculating every other column

    Are you sure?

    I tested it just now and got results with 0's and blanks in the columns...

    Do you have an error in one of those columns.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    02-16-2010
    Location
    Centrl Florida
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Exclude Zero Value Cells in a Sumproduct Formula calculating every other column

    Quote Originally Posted by NBVC View Post
    Are you sure?

    I tested it just now and got results with 0's and blanks in the columns...

    Do you have an error in one of those columns.
    They might also check to see if they have a number that is actually text which looks like a number. If so then they could get an error like that.

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Exclude Zero Value Cells in a Sumproduct Formula calculating every other column

    Quote Originally Posted by Weezy View Post
    They might also check to see if they have a number that is actually text which looks like a number. If so then they could get an error like that.
    Weezy, the above assertion is not correct.

    In this particular calculation a #DIV/0! could only result from an underlying error value.
    (there are no division calculations taking place within the SUMPRODUCT itself)

    The "Numbers stored as Text" error (assuming explicit coercion) would generally* generate #VALUE! errors (as opposed to #DIV/0!)
    *unless other errors are encountered first thus taking precedence

    If you can't correct for underlying errors at source (ie handling the #DIV/0!) then you can use an Array rather than SUMPRODUCT, ie:

    =SUM(IF(MOD(COLUMN(B12:CK12),2)*ISNUMBER(B12:CK12),IF((B12:CK12>0),B12:CK12)))
    confirmed with CTRL + SHIFT + ENTER

    However, accounting for underlying errors at source is generally advised.
    Last edited by DonkeyOte; 06-16-2010 at 02:41 AM. Reason: reworded

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0