+ Reply to Thread
Results 1 to 4 of 4

If cell contains text1, text2 or text 3 return this text, otherwise return X

Hybrid View

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question If cell contains text1, text2 or text 3 return this text, otherwise return X

    Hi all,

    I desperately need a formula using which I could differentiate two categories of countries..
    So there are two categories of countries, reliable ones and non-reliable ones. All of them are in one column, let's say Column A
    Reliable countries: Italy, USA, France, Spain, etc. Non-reliable countries China, Turkey, Egypt.

    I need a formula using which I could get value equal to the value in column A when it is a reliable country and value "non-reliable" when the country is non-reliable

    It would be great to get a result similar to this one:

    | A | B |
    ---------------------------
    1 | Italy | Italy |
    ---------------------------
    2 | China | Non-reliable |
    ---------------------------
    3 | USA | USA |
    ---------------------------
    4 | France | France |
    ---------------------------
    5 | Turkey | Non-reliable |
    ---------------------------
    6 | Spain | Spain |
    ---------------------------
    7 | Egypt | Non-reliable |
    -----------------------------

    Can anyone please advice me on this?


    Thanks in advance

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If cell contains text1, text2 or text 3 return this text, otherwise return X

    Make a list of your "Reliable" contries, in say E1:E20

    Then you can use
    =IF(ISNUMBER(MATCH(A1,E$1:E$20,0)),A1,"Non-reliable")

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: If cell contains text1, text2 or text 3 return this text, otherwise return X

    hi bukmanodrama, welcome to the forum. if you only have 3 countries which are unreliable, then:
    =IF(OR(A1={"China","Turkey","Egypt"}),"Unreliable",A1)

    otherwise, you can have the list somewhere else, say in F1:F3, then:
    =IF(COUNTIF($F$1:$F$3,A1),"Unreliable",A1)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    03-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: If cell contains text1, text2 or text 3 return this text, otherwise return X

    Thank you so much!

    I've been trying to make something like this for a while..

    I've tried the method provided by Jonmo1 , and it worked great!

    I have almost whole world in my list, so I believe that the second formula provided by benishiryo will work better. I'll try both of it a bit later and will let you know how it will work for me.

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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