+ Reply to Thread
Results 1 to 10 of 10

Need help in getting the value

  1. #1
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Need help in getting the value

    Hi, I have data something similar as below:

    A1 Category1 B1 Category2 C1 Code
    A2 Fruits B2 Apple C2 100
    A3 Fruits B3 Banana C3 101
    A4 Fruits B4 Oranges C4 102
    A5 Vegetable B5 Tomato C5 201
    A6 Vegetable B6 Potato C6 202


    Now in col F2 & G2 I have drop down from where I can Select Category1 and Category2, I need a formula for col H2 which can show me the code (which is col C) for the selected categories. Please help.

    Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: Need help in getting the value

    Just use VLOOKUP and search for Category 2. Category 1 is redundant unless you can have an item that is both Fruit and Vegetable.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134
    Quote Originally Posted by TMS View Post
    Just use VLOOKUP and search for Category 2. Category 1 is redundant unless you can have an item that is both Fruit and Vegetable.
    I have fruits listed as Tomato as well with a diff code..

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Need help in getting the value

    Try this...
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Category1 Category2 Code
    2
    Fruits Apple
    100
    Fruits Apple
    100
    3
    Fruits Banana
    101
    4
    Fruits Oranges
    102
    5
    Vegetable Tomato
    201
    6
    Vegetable Potato
    202

    H2=INDEX($C$2:$C$6,MATCH(F2&" "&G2,INDEX($A$2:$A$6&" "&$B$2:$B$6,0),0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Need help in getting the value

    I am unable to upload the sample excel file, so i attaching one picture of the excel sheet.
    In Col H2 , I need the code for the category1 and Category2, Please note that category2 can be same in for Category1 with different code. (like Tomato is in fruits as well as in vegetable with diff codes)

    Please help.

    Attachment 464192

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Need help in getting the value

    Why are you unable to upload a sample file?
    Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    (did you see my suggestion in post #4?

  7. #7
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Need help in getting the value

    Thank you FDibbins... it works perfectly the way i was looking for.. Thanks a ton..

  8. #8
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Need help in getting the value

    Thanks FDibbins, your previous reply worked very well..

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: Need help in getting the value

    Fair enough. Although, technically, I understood that a tomato WAS a fruit, NOT a vegetable

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Need help in getting the value

    happy to help

+ 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