Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Finding multiple values to return multiple values

  1. #1
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8

    Finding multiple values to return multiple values

    I was hoping to be able to use ELSEIF statements in an excel function, but I guess you can't?

    But basicallly, I have a bill of materials with a description column. I want to search that column for various words (ie. wheel, screw, spacer, shelf, etc) and return a value into another new column depending on that value (wheel inputs wheel, screw inputs hardware, spacer inputs hardware, shelf inputs shelf).

    How Excel shows you how to search will only return one value because I can't use an else statement:

    =IF(ISNUMBER(SEARCH("SCREW",C14)),"Hardware", "")
    Here's probably a harder issue - there needs to be a hierarchy to the code so that "shelf screw" would return screw.

    There's about 30 different categories (return values) and about 3-4 words (per category) that could be located in the description that should return that value.

    ie. SPACER, SCREW, NUT, BOLT will all return Hardware

    I have a feeling I might be in the wrong forum. http://i28.tinypic.com/2dlr975.gif (apparently image tags are disabled...lol)

    Thanks for any help!

  2. #2
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    BTW, I searched for a similar situation in this forum for about 30-45min before posting what I figured might be a constantly asked question. And I found this website using google to look for tutorials and help. So I did some digging around other sites before just bugging you guys for some suggestions. Sorry for being another random new guy looking for help

  3. #3
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    You're image link doesn't work for me....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  4. #4
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    Quote Originally Posted by NBVC
    You're image link doesn't work for me....
    Really? Maybe tinyurl gets work filtered some places. It's just a disturbed smile from another msg board I use. heh.

    BTW, I was born in Burlington, eh

  5. #5
    Valued Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Venezuela
    Posts
    696
    You could probably use a vlookup.

    In one sheet you would have the list of words and categories associated with them and the use a vlookup formula like this:

    =vlookup("*"&A1&"*",List!$A$1:$B$1000,2,0) dragged down.
    - Portuga

    There is no such thing as a problem, only a temporary lack of a solution


    In formulas,you might need to replace ; with , depending on your XL version

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Quote Originally Posted by blacksheep
    Really? Maybe tinyurl gets work filtered some places. It's just a disturbed smile from another msg board I use. heh.

    BTW, I was born in Burlington, eh
    Oh... I see that smile... but I thought you had attached a sample file image.....

    ... well Portuga's got some suggestions for you to try....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    Quote Originally Posted by Portuga
    You could probably use a vlookup.

    In one sheet you would have the list of words and categories associated with them and the use a vlookup formula like this:

    =vlookup("*"&A1&"*",List!$A$1:$B$1000,2,0) dragged down.
    I can't get that to do anything but find the first category written down and then N/A the rest of them. Maybe I just need to understand what lookup_value you're using means?

    BTW, in Sheet 2, I'm organizing them like:

    COL1 COL2
    SCREW Hardware
    SPACER Hardware
    NUT Hardware
    SHELF Shelf

    In Sheet1 it'll only look like
    PART1 Hardware
    PART2 #N/A
    PART3 #N/A


    ...I'd take screenshots but I can't put the BOMs online. :\

  8. #8
    Valued Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Venezuela
    Posts
    696
    You coud post the sheet (zipped preferably).
    Or just post the sheet (unziped)

    (less than 100K either way)
    - Portuga

    There is no such thing as a problem, only a temporary lack of a solution


    In formulas,you might need to replace ; with , depending on your XL version

  9. #9
    Valued Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Venezuela
    Posts
    696
    Hi blacksheep, but I just realized that the Vlookup solution I gave you is a bunch of C**p!

    Apologies. I think the solution would probably involve a match/index combination, with a named range... (maybe)
    - Portuga

    There is no such thing as a problem, only a temporary lack of a solution


    In formulas,you might need to replace ; with , depending on your XL version

  10. #10
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    It's not doing the N/A anymore, I guess I was messing with it...

    It's still doing something funky though.

    Thanks for the help btw..
    Last edited by blacksheep; 04-18-2008 at 03:45 PM.

  11. #11
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    I got it to do what I want with some very simple function use and ridiculous effort - it's also not perfect at doing what I need it to and is annoying to update. Hopefully you can better see my intent now.

    Thanks again!
    Last edited by blacksheep; 04-21-2008 at 04:27 PM.

  12. #12
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    Also, I have an easier question...

    The if statement that looks for ASH within the description is returning WASHER too. How do I tell it to look for ASH without any letters on either side?

    Thanks

  13. #13
    Valued Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Venezuela
    Posts
    696
    Hey,

    Just noticed something in your sheet...
    You have a unique part number.

    Why dont you have the list of all part numbers and then have a corresponding column for the "Type".

    Once you would have that list complete you just need a Vlookup formula.
    _____________________________________


    I had a very unelegant solution. Basically a concatenation of your original formula that might work.


    =IF(ISNUMBER(SEARCH("SCREW",C14)),"Hardware", "")&IF(ISNUMBER(SEARCH("BEZEL",C14)),"BEZEL", "")
    - Portuga

    There is no such thing as a problem, only a temporary lack of a solution


    In formulas,you might need to replace ; with , depending on your XL version

  14. #14
    Registered User
    Join Date
    04-18-2008
    Location
    Georgia
    Posts
    8
    Aha! That's how I combine the if statements! :D After doing some of them like that I'm not sure I like it that way though because of some of the issues with double categorizing. Maybe I can make the rules more specific and use it. Thanks for this!

    And unfortunately the part numbers, although unique, are not smart. So trying to use them to develop a category structure won't work. :\ The second that you think you see a pattern I could find you another list of them where someone screwed it up and used the wrong first digit. lol.

  15. #15
    Valued Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Venezuela
    Posts
    696
    The solution I gave you only concatenates different, one statement formulas.
    If you want to combine different conditions you can use the "or" or "and" in one if statement:
    Ex:

    IF(OR(ISNUMBER(SEARCH("SCREW",C14)),ISNUMBER(SEARCH("SPACER",C14)),ISNUMBER(SEARCH("SHELF",C14))),"HARDWARE", "")
    The formula above will return "hardware" if in C14 are words "screw"or "spacer" or Shelf"

    IF(AND(ISNUMBER(SEARCH("SCREW",C14)),ISNUMBER(SEARCH("SPACER",C14)),ISNUMBER(SEARCH("SHELF",C14))),"HARDWARE", "")
    The formula above will return "hardware" if in C14 are words "screw" and "spacer" and Shelf"
    - Portuga

    There is no such thing as a problem, only a temporary lack of a solution


    In formulas,you might need to replace ; with , depending on your XL version

Closed 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.2.0