+ Reply to Thread
Results 1 to 6 of 6

If cell contains value between x-y, should equal certain text

  1. #1
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    162

    If cell contains value between x-y, should equal certain text

    Hello!
    I'm trying to get a cell to display certain pre-defined text (from one of 5 other cells) if it equals a certain number range, e.g. 0-50 equals "Warning".

    It should also display certain colors depending on the value, but I think I got that covered with the conditional formatting.

    Any ideas?
    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If cell contains value between x-y, should equal certain text

    You need a table with the first column being the minimum of that catagory and the second being your text. i.e.
    0......warning
    51.....something else

    then use VLOOKUP(value to lookup, table range, column to return, TRUE) True is optional and means don't look for exact match (False only returns a value if there is an exact match) so if your table is in F1:G6 and your value is in A1
    =VLOOKUP(A1, $F$1:$G$6,2, TRUE)
    Does that help?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: If cell contains value between x-y, should equal certain text

    Thanks for you help. Can't get it to work though,. It gives me an "N/A".
    I've attached a copy of the file. Perhaps you can see where I've gone wrong? As you can see, cell B25 changes color depending on the value in B25. This is important to keep too.

    Number Equal Text.xlsx

    Cheers!

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If cell contains value between x-y, should equal certain text

    I fixed your table in D29:E34 and put the VLOOKUP in B30
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2010
    Posts
    162

    Re: If cell contains value between x-y, should equal certain text

    This works fine! Thanks ever so much ChemistB. You rock!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If cell contains value between x-y, should equal certain text

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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