+ Reply to Thread
Results 1 to 3 of 3

Return text string for a variety of different conditions

  1. #1
    Forum Contributor
    Join Date
    01-27-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    120

    Return text string for a variety of different conditions

    Hi,

    I would like an IF statement to look up the following conditions and return text strings dependent on the results:

    If the value in Cell A1 is >=27 and <=33 return *White"
    or
    If the value in Cell A1 is >=55 and <=65 return *Blue"
    or
    If the value in Cell A1 is >=42 and <=48 return *Yellow"
    or
    If the value in Cell A1 is >=85 and <=95 return *Green"
    or
    If the value in Cell A1 is >=115 and <=125 return *Pink"
    or
    If the value in Cell A1 is >=126 and <=144 return *Orange"
    or
    If the value in Cell A1 is >=177 and <=183 return *Grey"
    or
    If the value in Cell A1 is >=207 and <=213 return *Violet"
    or
    If the value in Cell A1 is >=202 and <=228 return *Purple"
    or
    If the value in Cell A1 is >=235 and <=245 return "Indigo"
    or
    If the value in Cell A1 is >=262 and <=275 return *Red"
    or
    If the value in Cell A1 is >=295 and <=305 return *Light Grey"
    or
    If the value in Cell A1 is >=327 and <=333 return *Dark Grey"
    or
    If the value in Cell A1 is >=312 and <=318 return *No Colour"

    Managed to get the following to work
    =IF(AND((B3)>=55,(B3)<=65),"Blue")

    but not for multiple conditions,

    Terry

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return text string for a variety of different conditions

    Hi

    Create a table with all your conditions(see my example) and then use an INDEX&MATCH formula to get your results.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    01-27-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    120

    Red face Re: Return text string for a variety of different conditions

    Works a treat!

    Many thanks

    Terry

+ 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. Search for text in a string return value of the text string.
    By gallegosdavidm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-21-2013, 10:55 AM
  2. [SOLVED] IF and Searching within text for a variety of terms
    By HParker in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2013, 10:55 AM
  3. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  4. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  5. Replies: 2
    Last Post: 02-26-2008, 03:22 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