Closed Thread
Results 1 to 17 of 17

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:

    Please Login or Register  to view this content.
    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. \1 (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 Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You're image link doesn't work for me....
    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.

  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
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    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.
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

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

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    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....

  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
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    You coud post the sheet (zipped preferably).
    Or just post the sheet (unziped)

    (less than 100K either way)

  9. #9
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    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)

  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
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    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.


    Please Login or Register  to view this content.

  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
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    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:

    Please Login or Register  to view this content.
    The formula above will return "hardware" if in C14 are words "screw"or "spacer" or Shelf"

    Please Login or Register  to view this content.
    The formula above will return "hardware" if in C14 are words "screw" and "spacer" and Shelf"

  16. #16
    Registered User
    Join Date
    01-14-2012
    Location
    colorado springs US
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Finding multiple values to return multiple values

    not sure if you still need this but here is an option =IF(A2="SCREWS","HARDWARE",IF(A2="NUTS","HARDWARE",IF(A2="BOLTS","HARDWARE",IF(A2="BRACKETS","HARDWARE",IF(A2="NAILS","HARDWARE",IF(A2="DESK","FURNITURE",IF(A2="CHAIR","FURNITURE",IF(A2="SINK","PLUMBING",IF(A2="FAUCET","PLUMBING")))))))))
    just added the other last four as examples of multiple departments
    hope this help can do something similar with vlookup but it uses more resources, this is often a quicker solution

  17. #17
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Finding multiple values to return multiple values

    Hi NEW PERSON
    Welcome to excel forum
    The post is from 2008 I doubt if you wil get a reply
    The thread dates are displayed in the top left of the posts
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

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.6.0 RC 1