+ Reply to Thread
Results 1 to 8 of 8

Show text or a blank, depending on value in other cell

  1. #1
    Registered User
    Join Date
    02-02-2023
    Location
    Toronto, Canada
    MS-Off Ver
    2019
    Posts
    4

    Show text or a blank, depending on value in other cell

    Dear all,
    I am a novice in excel and don't seem to be able to solve this simple formula. Referring to the attachment I have a field for a number. If the number falls within a parameter it will display a message ie. "DEFCON 4". If there is no value or DIV/0 the status will show nothing - blank.
    I am sure for you experts this is a no-brainer and you are probably laughing!
    Thanks again for your time and effort.

    God bless...

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #1 requires good titles. "Need help with a formula PLEASE!" does not tell us about your question. I have updated it for you this time because you are a new member. --6StringJazzer
    Attached Files Attached Files
    Last edited by 6StringJazzer; 02-03-2023 at 11:31 PM. Reason: better titles please

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Show text or a blank, depending on value in other cell

    Welcome to the Forum JobReza!


    No question too small

    Formula implemented in attachment

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-09-2020
    Location
    United States
    MS-Off Ver
    Microsoft Office Home and Business 2021
    Posts
    19

    Re: Show text or a blank, depending on value in other cell

    Hello! In Excel, the #DIV/0! The error occurs when you try to divide a number with a zero, or you have a value equivalent to a zero, which can be a blank value. You can fix it by using an IFERROR formula.

    In cell D2, try the formula below. The formula states that if the value in cell A10 (Input value 0.65) is greater than the value in column A and smaller than the value in column B to return a "DEFCON 4" result and if not, to not display anything at all. With the current data you've provided, the formula provided did not return a #DIV/0! result. This can be used to return a text result of "DEFCON 4" (or whatever text/number you wish) beside each row of data. My apologies for misinterpreting that you wanted a calculated result in a single cell.

    =IF(AND($A$10>A2,$A$10<B2),"DEFCON 4","")

    Hope this helps!
    Last edited by nicnaws; 02-03-2023 at 11:46 PM. Reason: If you want results displayed beside each row of data; misinterpreted single cell result

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,065

    Re: Show text or a blank, depending on value in other cell

    Try this, B10=IFERROR(IF(A10="","",IF(OR(A10<A2,A10>B7),"outside parameters",LOOKUP(A10,A2:A7,C2:C7))),"").

  5. #5
    Registered User
    Join Date
    02-02-2023
    Location
    Toronto, Canada
    MS-Off Ver
    2019
    Posts
    4

    Re: Show text or a blank, depending on value in other cell

    Thanks so much for your time. Very kind of you.
    By the way I used to live in Tysons Corner many years ago. Miss it so much.
    God bless...

  6. #6
    Registered User
    Join Date
    02-02-2023
    Location
    Toronto, Canada
    MS-Off Ver
    2019
    Posts
    4

    Re: Show text or a blank, depending on value in other cell

    Thanks to all of you for your time and expertise. Much appreciated.
    Have a great weekend.
    God bless...

  7. #7
    Registered User
    Join Date
    02-02-2023
    Location
    Toronto, Canada
    MS-Off Ver
    2019
    Posts
    4

    Re: Show text or a blank, depending on value in other cell

    Hi,
    Can I bother you with one last question? If the value in A10 is the result of a cell divided by zero (DIV/0), is there anyway to fix it and display another status ie. "Free Clear" in cell B10?
    Pertaining to this formula: IF(A10="","",INDEX($C$2:$C$7,MATCH($A$10,$A$2:$A$7,1)))
    Thanks again.
    Last edited by JobReza; 02-04-2023 at 12:58 PM.

  8. #8
    Registered User
    Join Date
    02-09-2020
    Location
    United States
    MS-Off Ver
    Microsoft Office Home and Business 2021
    Posts
    19

    Re: Show text or a blank, depending on value in other cell

    Hello JobReza!

    The current formula =IF(A10="","",INDEX($C$2:$C$7,MATCH($A$10,$A$2:$A$7,1))) returns a #DIV/0! result (cell B3 has a value of zero, and cell C3 function is =A3/B3; you will receive a #DIV/0! result if you try to divide by zero). To fix this, all you need to do is embed this entire formula inside of an IFERROR formula.

    IFERROR has two arguments: "value" and "value if error". The value is IF(A10="","",INDEX($C$2:$C$7,MATCH($A$10,$A$2:$A$7,1))) and the "value if error" is "Free Clear" (inside the quotation marks you can specify whatever text you want, or if you don't want anything displayed, use "").

    The formula is: =IFERROR(IF(A10="","",INDEX($C$2:$C$7,MATCH($A$10,$A$2:$A$7,1))),"Free Clear")

    Hope this helps!
    Last edited by nicnaws; 02-04-2023 at 04:06 PM. Reason: Additional Info

+ 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: 03-24-2020, 07:27 AM
  2. Replies: 3
    Last Post: 01-10-2019, 09:34 AM
  3. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  4. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  5. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  6. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  7. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04: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