+ Reply to Thread
Results 1 to 10 of 10

how to search for a spesific word with in a cell and display in the next cell (HELP!!!!)

  1. #1
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    how to search for a spesific word with in a cell and display in the next cell (HELP!!!!)

    Good morning all,

    I have a list of cells that contain words and colors (e.g Vivid fancy yellow), i would like to have the next cell contain just the color (e.g yellow).... after some searching on Google i came up with this code: =IF(SEARCH("Yellow",T17),"Yellow"), that works great for the ones that are yellow however when i try to add the next color as follows: =IF(SEARCH("Yellow",T17),"Yellow",IF(SEARCH("Orange",T17),"Orange"))(i need to do it for about 6 or 7 colors).

    Please Advise on what i am doing wrong.

    Joseph

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

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    hi Joseph, do up a list of colours say in D1:D2. then assuming your data is in T17:
    =IF(ISNA(LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2)),"",LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2))

    extend the ranges of column D if you need

    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

  3. #3
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    Thanks!!!

    IT WORKED!!!!!!!

  4. #4
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    Part two of this question that i just realized that i didnt put in....
    =IF(U3=OR("Yellow","Orange","Blue","Green","Brown","Pink","Champagne"),U3,"None" (U3 is where i put the code that you helped me with in the last question) is returning me a value error any idea why ?

    Thanks again!

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

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    try this instead:
    =IF(OR(U3={"Yellow","Orange","Blue","Green","Brown","Pink","Champagne"}),U3,"None")

    and you're very welcome

  6. #6
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    I Tried it and the answer is coming up incorrect meaning in the column it says yellow but your formula is returning "NONE"

    Any ideas ?

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    Quote Originally Posted by benishiryo View Post
    =IF(ISNA(LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2)),"",LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2))
    For Excel versions prior to Excel 2007 this would be more efficient:

    =LOOKUP("zzz",CHOOSE({1,2},"",LOOKUP(1E100,SEARCH($D$1:$D$2,T17),$D$1:$D$2)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    Ok i got it there was value that got input in the wrong place and it was throwing the whole thing off

    Thanks to all that helped

  9. #9
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    Hey all i have come across an issue that just came up with this string if based on the formula "=IF(ISNA(LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2)),"",LOOKUP(2^15,SEARCH($D$1:$D$2,T17),$D$1:$D$2))" (thanks again benishiryo)
    the value in t17 is Yellow(Colored) what do i need to change so that it wont give me a zero. I have the color yellow in my "D:D" list.

    Thanks !!!!

  10. #10
    Forum Contributor
    Join Date
    02-17-2013
    Location
    israel
    MS-Off Ver
    Excel 2003
    Posts
    106

    Re: how to search for a spesific word with in a cell and display in the next cell (HELP!!!

    I solved it.

+ 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