+ Reply to Thread
Results 1 to 7 of 7

SUMIF to return blank if value not available

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Bentley, NM
    MS-Off Ver
    Excel 2010
    Posts
    229

    SUMIF to return blank if value not available

    It appears that my SUMIF formulas always returns 0 even if there are no values available. The problem is that there are cases when the SUMIF could legitimately return a 0 and I need to distinguish between the two instances, so that other formulas will work. If the SUMIF is truly 0 then I need to see the 0, but if there are no values available for the SUMIF then I would like to see a blank cell.

    An example SUMIF:
    Please Login or Register  to view this content.
    In the case above, there are no values in 'AR_test' for the conditions specified, so I would like to see a blank cell. However, if there are values and the values sum to 0 then I need to see the 0. I hope that makes sense. Thanks.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,470

    Re: SUMIF to return blank if value not available

    Try this:

    =iferror(SUMIF(AR_test!$A:$R,CONCATENATE($B$3,R$3),AR_test!$G:$G),"")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: SUMIF to return blank if value not available

    Please Login or Register  to view this content.

    Like that?
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: SUMIF to return blank if value not available

    Maybe =IF(COUNTIF(AR_test!$A:$R,CONCATENATE($B$3,R$3))=0,"",SUMIF(AR_test!$A:$R,CONCATENATE($B$3,R$3),AR_test!$G:$G))

  5. #5
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Bentley, NM
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: SUMIF to return blank if value not available

    Thanks everyone. IFERROR won't work because there is no error. COUNTIF is perfect as long as I understand it correctly, and I think both of your formulas will work. COUNTIF searches the range for my concatenation and if it isn't there it returns a blank? Sounds good to me.

  6. #6
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: SUMIF to return blank if value not available

    JieJenn and I actually had slightly different logical tests.

    JJ's returns a blank when there are exactly zero cells with the concatenation in range and the sum otherwise,
    Mine returns the sum when there are more than zero cells with the concatenation in the range, and blank otherwise.

    So technically the logical test will give different results when the COUNTIF is below zero; but since unmodified COUNTIF can't do that, it doesn't really matter.

  7. #7
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Bentley, NM
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: SUMIF to return blank if value not available

    Sounds good. Thanks again.

+ 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. Index/ Match Formula, How to return blank cell as a blank not 0
    By MDResearcher in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-24-2016, 08:40 PM
  2. [SOLVED] When my formula encounters a blank cell it returns a 0, I need it to return a blank
    By stretch99 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-27-2014, 07:52 PM
  3. [SOLVED] Need formula to return blank instead of #N/A when source cell is blank, using VLOOKUP
    By TMB1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-03-2013, 07:16 PM
  4. Replies: 4
    Last Post: 07-23-2012, 04:54 PM
  5. SUMIF Question: SUMIF not blank
    By nickyg in forum Excel General
    Replies: 5
    Last Post: 11-18-2009, 10:07 PM
  6. Replies: 3
    Last Post: 11-22-2007, 07:53 AM
  7. Sumif to return a blank if sum range is blank
    By [email protected] in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2006, 05:30 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