+ Reply to Thread
Results 1 to 12 of 12

IFERROR(SUMIFS returns 0 and not the alternate formula?

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    IFERROR(SUMIFS returns 0 and not the alternate formula?

    Hi,

    I have this formula but since 0 is a number and not an error it is returning 0's instead of my error furmula. What would be the best way to go about fixing this?

    =IFERROR(SUMIFS(Billed!$D:$D,Billed!$A:$A,F72,Billed!$B:$B,$B72),IF(F74="Internal",(F76/(1+15%)),(F76/(1+F73+6%))))

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    .

    Taking a stab here - formulas are not my forte' :

    Please Login or Register  to view this content.
    Note the addition at the end of the formula.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    You don't need all the brackets

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


    However, the only way I can see to get an error in the first part of the formula is if F72 or B72 generate an error, for example, #VALUE!
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    Quote Originally Posted by Logit View Post
    .

    Taking a stab here - formulas are not my forte' :

    Please Login or Register  to view this content.
    Note the addition at the end of the formula.
    This wont paste correctly said too many arguments.

  5. #5
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    Quote Originally Posted by TMS View Post
    You don't need all the brackets

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


    However, the only way I can see to get an error in the first part of the formula is if F72 or B72 generate an error, for example, #VALUE!
    This one cut back on the number of brackets but didnt actually solve the issue of returning 0.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    Post a sample workbook with some typical data.

  7. #7
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    A little late on my part. I have attached a sample file. F16 hold the desired result of H16. G16 is my attempt at a formula, both F16 and G16 are correct answeres the difference being that when i try to combine the if statement into an iferror statement as done in cell G16 and H16 the error part does not work because a sum of $0 is not actually an error.

    Thanks,
    Mike
    Attached Files Attached Files

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    The problem is exactly as you initially stated yourself in the original post.
    The result of 0 from sumifs is NOT an error, therefore IFERROR will never do anything with it.

    Try
    =IFERROR(1/(1/SUMIFS(Billed!$D:$D,Billed!$A:$A,F72,Billed!$B:$B,$B72)),IF(F74="Internal",(F76/(1+15%)),(F76/(1+F73+6%))))

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

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


    What sort of error do you think you'll get from a SUMIFS? Unless you have error values in the data being checked or summed, it will either return a value or zero.

    For testing purposes, I set all the entries in column B in the Spend sheet to 611. All the months returned values. So, I am content that the formula is OK ... although note that I have changed some of the references to partially absolute (but it shouldn't make a difference).

    I can't see how you will EVER execute the IFERROR part of the formula.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    If you want to execute the "IFERROR" part of the formula if the SUMIFS is zero, you need to test the SUMIFS output for a zero return.


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

  11. #11
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    So both of these work and i thank you both for your help. Is any one of these better than the other if i had to use multiple statements to look up multiple item ids? i.e 611, 118, 356 for sum values?


    Quote Originally Posted by TMS View Post
    If you want to execute the "IFERROR" part of the formula if the SUMIFS is zero, you need to test the SUMIFS output for a zero return.


    Comme ci
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Quote Originally Posted by Jonmo1 View Post
    The problem is exactly as you initially stated yourself in the original post.
    The result of 0 from sumifs is NOT an error, therefore IFERROR will never do anything with it.

    Try
    =IFERROR(1/(1/SUMIFS(Billed!$D:$D,Billed!$A:$A,F72,Billed!$B:$B,$B72)),IF(F74="Internal",(F76/(1+15%)),(F76/(1+F73+6%))))

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IFERROR(SUMIFS returns 0 and not the alternate formula?

    In the first one, you're doing the sumifs twice.
    Once to test if it's 0, then again to return it's value when it's not 0.

    Mine should be more efficient.
    It's applying just a little math to the result of sumif which basically forces a 0 into an error therefore allowing iferror to trap it.

+ 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. Replies: 3
    Last Post: 01-13-2016, 12:05 PM
  2. USING SUMIFS formula returns a '0' for me
    By jlp83 in forum Excel General
    Replies: 7
    Last Post: 03-12-2015, 06:53 AM
  3. [SOLVED] sumifs formula returns error
    By kronikjb in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-08-2015, 12:51 PM
  4. [SOLVED] IFERROR with SUMIFS
    By shiftyspina in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-11-2013, 09:25 AM
  5. Sumifs formula returns ZERO
    By Xx7 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-10-2013, 02:05 PM
  6. Can I get an iferror to revert back to the previous value if the value returns an error
    By mconnelly2012 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2013, 08:13 PM
  7. [SOLVED] IFERROR and VLOOKUP returns N/A can you help me fix it
    By godlev in forum Excel General
    Replies: 2
    Last Post: 12-21-2011, 06:27 AM

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