+ Reply to Thread
Results 1 to 13 of 13

SUMIFS produces a value of 0 when a second criterion is added

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    SUMIFS produces a value of 0 when a second criterion is added

    Hi,

    I am trying to use the SUMIFS function to evaluate a sum based on two criteria. The formula I am using is:

    =SUMIFS(Teaching!$V$6:$V$218,Teaching!$C$6:$C$218,C5-2500,Teaching!$D6:$D218,0)

    which, as far as I can tell, is of the correct form. Column C contains numbers identifying a category, and column D is mostly blank except for a few rows which contain a short string. I want to sum all those figures in column V which belong to a certain category (calculated by C5-2500) but excluding those which have a string in column D - i.e. only those where the cell in column D is blank.

    When I enter the formula with only the first criterion it evaluates correctly, but on adding the second it always evaluates to zero.

    Can anyone spot what is going wrong with this?

    Thanks!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Are you sure the values in D2:D218 are actually 0?
    If posting code please use code tags, see here.

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: SUMIFS produces a value of 0 when a second criterion is added

    if column D is blank use

    =SUMIFS(Teaching!$V$6:$V$218,Teaching!$C$6:$C$218,C5-2500,Teaching!$D6:$D218,"")
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: SUMIFS produces a value of 0 when a second criterion is added

    criteria for blank is "=" non blank is "<>"

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    07-16-2013
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Thanks everyone. I thought I'd already tried all those variations for blank cells before and it still hadn't worked, but now I've tried it again and it's much better. Perhaps I got myself confused with a formula elsewhere...

  6. #6
    Registered User
    Join Date
    07-16-2013
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Sorry to reopen this but it turns out it's not quite solved after all: it is now giving the correct total when all the cells in column D are blank but is not ignoring those which are not blank. I've tried using "=" and "" but they both produce the wrong answer.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: SUMIFS produces a value of 0 when a second criterion is added

    please provide a workbook where that happens

  8. #8
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Please upload sample file..

    I am confused with this line..
    it is now giving the correct total when all the cells in column D are blank but is not ignoring those which are not blank
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  9. #9
    Registered User
    Join Date
    07-16-2013
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUMIFS produces a value of 0 when a second criterion is added

    I'm afraid I can't upload the file since the contents is confidential. I could create a mock version but I'm not sure that would be any more use than what I can tell you.


    I am confused with this line..
    it is now giving the correct total when all the cells in column D are blank but is not ignoring those which are not blank
    What I meant was that when all the cells in column D are blank the correct value is returned, but when there are cells which are not blank it appears to include them in the sum, although the formula is designed to ignore those values.

  10. #10
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Did you tried martindwilson's suggestion.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Quote Originally Posted by apkdsmith View Post
    I could create a mock version but I'm not sure that would be any more use than what I can tell you.
    I reckon that would be useful-it would at least enable us to rule out computer settings if we see the same problem

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: SUMIFS produces a value of 0 when a second criterion is added

    are the cells really blank ,where did you get the data thats in them,or if its a formula in there what is it?

  13. #13
    Registered User
    Join Date
    07-16-2013
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: SUMIFS produces a value of 0 when a second criterion is added

    Thanks for your help. I didn't exactly manage to solve it, but I circumvented the problem by reworking it slightly differently.

+ 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. X that produces the highest Y
    By TheFormulamonster in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2013, 04:40 PM
  2. SUMIFS Puzzle - Trying to avoid adding multiple SUMIFS to get valid result
    By haldavid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-09-2013, 03:42 PM
  3. [SOLVED] Sumifs, problem with the formula: =sumifs(c10:c200,<=today(),0)
    By Faustocruz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2012, 04:26 AM
  4. [SOLVED] Additional criterion date function to be added to existing formula
    By Christopherdj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2012, 02:07 AM
  5. Column SUM produces #N/A
    By JOGIER in forum Excel General
    Replies: 3
    Last Post: 12-24-2008, 03:33 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