+ Reply to Thread
Results 1 to 9 of 9

Formula to display nothing if false

  1. #1
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Formula to display nothing if false

    Hello

    I have this simple formula in a table: =SUM(A1/B1)

    I want it to display nothing when A1 and B1 are empty - at present it returns:
    #DIV/0!

    Can anyone help? Thanks.

    Dan

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Formula to display nothing if false

    First, you don't need SUM function.

    You can try this: =IF(B1;A1/B1;"")

    (replace ; with , if you get error)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula to display nothing if false

    Sometimes to safer to check coerced value of divisor (ie IF("apple" would return TRUE)

    =IF(N(B1),A1/B1,"")

    however if A1 is non-numeric you will also get a #VALUE! error - if that is a concern also then best to use an all encompassing error check - ie double evaluate.

  4. #4
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Formula to display nothing if false

    Thanks for both replies. The 1st solved the problem. I havent tried the 2nd, but thanks anyway. Thanks.

    Dan

  5. #5
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Formula to display nothing if false

    just realised that I would also like the formula to ask if AF1923 is empty and if so, also return "--"

    Here is the current formula:
    =IF(AB1923,AI1923/AB1923,"--")

    Can anyone help? Thanks.

    Dan

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Formula to display nothing if false

    And it doesn't working?

    DQ, I agree. However, maybe it's not bad to get error when divisor is text (as for a number). Depending on users wish...

  7. #7
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Formula to display nothing if false

    It works fine, I just want to change the IF statement slightly. Ignore my post above I got confused.

    My original formula is this:
    =SUM(AI1914/AB1914)

    I want the formula to return nothing if AF1914 is empty, if it is not empty then it can continue to do the sum. Any ideas on how to express this? Sorry for my confusion.

    Dan

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Formula to display nothing if false

    =if(af1914="","",if(ab1914,ai1914/ab1914,"--"))

  9. #9
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: Formula to display nothing if false

    Thanks a lot. That works perfectly.

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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