+ Reply to Thread
Results 1 to 5 of 5

ISNUMBER AND OR Help Please

  1. #1
    Registered User
    Join Date
    06-18-2009
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    5

    ISNUMBER AND OR Help Please

    I need help with a statement, I know the logic but not sure how to write it in Excel. If someone can help me out that would be great.
    I need a statement that does this:

    If B2 contains the word shampoo then "Hair Care ~ Shampoo", OR if B2 contains the word conditioner then "Hair Care ~ Conditioner", OR if B2 contains cleanse then "Hair Care ~ Shampoo", OR if B2 contains Treatment then, "Hair Care ~ Treatment", Etc...

    This is what I have thus far and it works for only shampoo.. but, where do I put the OR statement(s)? does excel do loops? ughhhh lol Help me please

    =IF(ISNUMBER(SEARCH("shampoo",B2)),"Hair Care ~ Shampoo","")

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: ISNUMBER AND OR Help Please

    Better if you create a table on the side that lists the possible search words and beside them, what you want to return... then use formula like this:

    ="Hair Care ~ "&=INDEX($H$2:$H$10,MATCH(1,SEARCH("*"&$G$2:$G$10&"*",B2),0))

    where G2:G10 contain search words and H1:H10 contain words to append to the string "Hair Care ~ "

    After you adjust the ranges in the formula to suit the table you create, you need to confirm it with CTRL+SHIFT+ENTER not just ENTER and then copy it down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-18-2009
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: ISNUMBER AND OR Help Please

    I Created 2 columns that looked like this under columns BB and BC
    shampoo Hair Care ~ Shampoo
    shampoo Hair Care ~ Shampoo
    rinse Hair Care ~ Shampoo
    conditioner Hair Care ~ Conditioner
    masque Hair Care ~ Treatment
    treatment Hair Care ~ Treatment
    gel Hair Care ~ Styling
    spray Hair Care ~ Styling
    wax Hair Care ~ Styling

    and used this formula and its not working:
    ="Hair Care ~ "&=INDEX($BB$2:$BB$10,MATCH(1,SEARCH("*"&$BC$2:$BC$10&"*",B2),0))

    What am I doing wrong?
    When I hit Ctrl + shift + enter it corrected the formula and gave me this:
    ="Hair Care ~ "&INDEX($BB$2:$BB$10,MATCH(1,SEARCH("*"&$BC$2:$BC$10&"*",B2),0))

    Just to clear it up, this is what I need. Do i need to create a table or can i just make 2 columns in BB and BC?

    B2 contains a string of text and if in that string it contains the word on the left side of the column then i need it to spit out into Z2 the string that is on the right side.
    So If:
    B2 contains: Bumble and Bumble Gel
    Z2 should say: Hair Care ~ Styling

    so:
    G H I.J... Z
    1
    2 Bumble and Bumble Gel Hair Care ~ Styling
    3 Goldwell Shampoo Hair Care ~ Shampoo
    4
    5

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: ISNUMBER AND OR Help Please

    Just to clear it up, this is what I need. Do i need to create a table or can i just make 2 columns in BB and BC?
    That is a table...

    if the final string always starts with Hair Care ~ then you don't need to add them to all entries in BC.. my formula adds it...

    otherwise, take that initial part out of my formula and keep BC as you want.
    Last edited by NBVC; 06-18-2009 at 03:09 PM.

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: ISNUMBER AND OR Help Please

    Hi,

    Maybe this will help?
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

+ 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