+ Reply to Thread
Results 1 to 4 of 4

How to turn cell blank if SUMIF, COUNTIF condition not met

  1. #1
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Lightbulb How to turn cell blank if SUMIF, COUNTIF condition not met

    Hello,

    Is there anyway I can turn the field blank if SUMIFS, COUNTIFS conditions not satisfied. I am using the below formulas which is working fine. But when the conditions not satisfied, I am getting 0. I wanted the field to be blank.

    =SUMIFS(Data!$O$4:$O$1000,Data!$B$4:$B$1000,$G5&"*",Data!$M$4:$M$1000,"Y", Data!$K$4:$K$1000,">="&$B$2,Data!$K$4:$K$1000,"<="&$D$2)

    =COUNTIFS(Data!$B$4:$B$1000,$G5&"*",Data!$G$4:$G$1000,$I$4&"*",Data!$K$4:$K$1000,">="&$B$2,Data!$K$4:$K$1000,"<="&$D$2,Data!$M$4:$M$1000,"*Y*")

    Thank you,
    Best regards

  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,939

    Re: How to turn cell blank if SUMIF, COUNTIF condition not met

    The long version...
    =if(SUMIFS(Data!$O$4:$O$1000,Data!$B$4:$B$1000,$G5&"*",Data!$M$4:$M$1000,"Y", Data!$K$4:$K$1000,">="&$B$2,Data!$K$4:$K$1000,"<="&$D$2)=0,"",SUMIFS(Data!$O$4:$O$1000,Data!$B$4:$B$1000,$G5&"*",Data!$M$4:$M$1000,"Y", Data!$K$4:$K$1000,">="&$B$2,Data!$K$4:$K$1000,"<="&$D$2)

    The short version - if there is something specific in those ranges/criteria that, if that is empty, all will be empty, then try this...
    =if(your-selected-cell="","",SUMIFS(Data!$O$4:$O$1000,Data!$B$4:$B$1000,$G5&"*",Data!$M$4:$M$1000,"Y", Data!$K$4:$K$1000,">="&$B$2,Data!$K$4:$K$1000,"<="&$D$2))
    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 Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: How to turn cell blank if SUMIF, COUNTIF condition not met

    Try:

    =IFERROR(1/(1/"your formula"),"")

  4. #4
    Registered User
    Join Date
    02-11-2017
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    98

    Re: How to turn cell blank if SUMIF, COUNTIF condition not met

    Thanks Phuocam. I tried it and its working.

+ 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. If cell contains a date then another cell should turn to sero or blank?
    By sissyboot in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-15-2015, 04:03 PM
  2. Replies: 6
    Last Post: 06-08-2015, 05:20 PM
  3. [SOLVED] Countif until blank cell (mutiple blank cells)
    By plasma33 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-07-2015, 01:14 PM
  4. Turn blank cell to hyphen in particular cell
    By jcmckeon in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-12-2014, 10:11 PM
  5. How to sumif with condition = blank cell?
    By Poey in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-29-2013, 03:24 AM
  6. Sumif function condition cell value
    By borut_p in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2009, 03:02 PM
  7. Replies: 3
    Last Post: 11-03-2009, 03:06 PM

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