+ Reply to Thread
Results 1 to 4 of 4

How to keep cell blank if formula = 0?

  1. #1
    Registered User
    Join Date
    12-02-2021
    Location
    New York
    MS-Off Ver
    2007
    Posts
    7

    How to keep cell blank if formula = 0?

    Hi all,

    In document -> "dashboard" sheet -> cell B8
    Currently cell B8 has the correct formula which calculates cells B6 / B5. It is also set to format custom 0% "WIN RATE"

    But if the values of both B5 and B6 are 0, how would I make cell B8 appear blank? Currently when the values are 0 it shows as "#DIV/0!"
    I would like it to only show the formula result if there is a 1 in both B5 and B6.

    Thanks in advance all
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: How to keep cell blank if formula = 0?

    Maybe wrap it in an IFERROR formula? Like this?
    =IFERROR(SUMPRODUCT(COUNTIFS(Trades!N:N,"NO",Trades!C:C,{"LONG","SHORT"}))/SUMPRODUCT(COUNTIF(Trades!C:C,{"LONG","SHORT"})),"")

  3. #3
    Registered User
    Join Date
    12-02-2021
    Location
    New York
    MS-Off Ver
    2007
    Posts
    7

    Re: How to keep cell blank if formula = 0?

    Hi Greg,

    That works perfectly. Thank you so much!

  4. #4
    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 keep cell blank if formula = 0?

    HEres another option...
    =IF(SUM(B5:B6)=0,"",SUMPRODUCT(COUNTIFS(Trades!N:N,"NO",Trades!C:C,{"LONG","SHORT"}))/SUMPRODUCT(COUNTIF(Trades!C:C,{"LONG","SHORT"})))

    Note that using full column references with SUMPRODUCT could slow your file down - try to use only the range you need (if the range will grow, try 3-3 time what you need.)
    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

+ 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. [SOLVED] IF formula to have interest cell go to 0 (blank) when adjacent balance cell is 0 (blank)
    By BryanHCR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2019, 03:38 PM
  2. Replies: 1
    Last Post: 06-29-2016, 03:44 AM
  3. Replies: 11
    Last Post: 09-15-2014, 02:36 AM
  4. [SOLVED] If formula in one cell refers to another cell which is blank result is a blank cell
    By M-Tommo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-03-2014, 08:29 AM
  5. [SOLVED] Cell referenced in formula has no information displayed (shows blank), return blank cell
    By nunayobinezz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2013, 04:51 PM
  6. Mac Excel: Hiding rows if cell blank, when being blank depends on a conditional formula
    By lee_5_5 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 06-06-2013, 11:25 PM
  7. I want a formula cell to be blank if cells computing formula are blank
    By asawyer3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2011, 05:24 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