+ Reply to Thread
Results 1 to 9 of 9

Retrieving values based on matching values on separate worksheets

  1. #1
    Forum Contributor
    Join Date
    12-13-2007
    Posts
    138

    Retrieving values based on matching values on separate worksheets

    Is it possible to have a formula where it will retrieve a specific value on one sheet based on matching values? Unfortunately, hlookup wont work as there are several values in the table where the 'lookup_value' is the same.

    Example:

    On sheet 1 (titled BSRC), I have a table which has a list of values in column 1. On column two I have the 'lookup value' which needs to be matched and all values underneath it to be retrieved from sheet 2 (titled CSRD). The 'lookup_value' range is on row 9 of sheet 2.

    I have attached a sample spreadsheet for clarification.

    Edit - refer to post #3 for attachment.
    Last edited by FM1; 02-17-2010 at 11:53 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Retrieving values based on matching values on separate worksheets

    Can you provide some sample results? Can you highlight where you've inserted these sample results manually so we can spot what you're after?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    12-13-2007
    Posts
    138

    Re: Retrieving values based on matching values on separate worksheets

    New sample sheet attached.

    All cells highlighted in grey in BSRC sheet are the ones I have input manually.

    I have also added a few more notes which should clarify my question a bit.

    Essentially, what I need is an hlookup where there are multiple occurences of the 'lookup_value'.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Retrieving values based on matching values on separate worksheets

    Based on the sample set, I think a better "match value" is the SR40, SR41, etc.

    Place this formula in C5 and then copy down and across the table:

    =INDEX(CSRD!$E$17:$BB$33, MATCH($A5, CSRD!$C$17:$C$33, 0), MATCH(C$4, CSRD!$E$12:$BB$12, 0))

  5. #5
    Forum Contributor
    Join Date
    12-13-2007
    Posts
    138

    Re: Retrieving values based on matching values on separate worksheets

    Quote Originally Posted by JBeaucaire View Post
    Based on the sample set, I think a better "match value" is the SR40, SR41, etc.

    Place this formula in C5 and then copy down and across the table:

    =INDEX(CSRD!$E$17:$BB$33, MATCH($A5, CSRD!$C$17:$C$33, 0), MATCH(C$4, CSRD!$E$12:$BB$12, 0))
    Unfortunately, the SR40, SR41, etc. is not hardcoded and should be a result of the lookup (if that makes sense). Those references need to be dynamic as the lookup_value will change depending on the data that requires analysis, i.e. it can change from V. Good to good, to low, etc, in which case it wont always be SR40, SR41, etc.

    The end use of this will be a bar chart so hardcoding the SR values is not an option as it will leave long gaps within the graph.

    Hope that makes sense.
    Last edited by FM1; 02-17-2010 at 09:30 AM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Retrieving values based on matching values on separate worksheets

    In C4 and copied across row 4:

    =INDEX(CSRD!$E$12:$BB$12, MATCH($B$4, CSRD!$E$9:$BB$9, 0) + COLUMN(A$1) -1)

    In C5, then copied down and across the table:
    =INDEX(CSRD!$E$17:$BB$33, MATCH($A5, CSRD!$C$17:$C$33, 0), MATCH($B$4, CSRD!$E$9:$BB$9, 0) + COLUMN(A$1) - 1)

  7. #7
    Forum Contributor
    Join Date
    12-13-2007
    Posts
    138

    Re: Retrieving values based on matching values on separate worksheets

    Quote Originally Posted by JBeaucaire View Post
    In C4 and copied across row 4:

    =INDEX(CSRD!$E$12:$BB$12, MATCH($B$4, CSRD!$E$9:$BB$9, 0) + COLUMN(A$1) -1)

    In C5, then copied down and across the table:
    =INDEX(CSRD!$E$17:$BB$33, MATCH($A5, CSRD!$C$17:$C$33, 0), MATCH($B$4, CSRD!$E$9:$BB$9, 0) + COLUMN(A$1) - 1)
    Thanks very much for that Jbeaucaire. Worked perfectly!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Retrieving values based on matching values on separate worksheets

    Glad to help.

    NOTE: Just use the QUICK REPLY box below to carry on normal conversation. Unnecessary use of the QUOTE button just clutters the thread and makes it hard to read. Cheers.

  9. #9
    Registered User
    Join Date
    05-20-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    5

    Retrieving one cell value based on other two columns cell value

    Retrieving one cell value based on other two columns cell value
    Hi to all!!!

    Herewith I am attaching the table


    Column 1 Column 2 Column 3
    Row 1
    a c Result
    Row 2
    a c 1
    Row 3
    b d 2
    Row 4
    a d 5
    Row 5
    b c 4


    -- Row 1 and Column 1 matching Cell -- and -- Row 1 and Column 2 matching Cell -- are input cells

    -- Row 1 and Column 3 matching Cell -- is Result cell

    My Requirement:

    If I enter "a" in --Row 1 and Column 1 matching Cell -- and "c" in
    -- Row 1 and Column 2 matching Cell -- means the corresponding value from Row 2 to Column 3 range cell has to display in -- Row 1 and Column 3 matching Cell --

    Ex:

    Row 1 and Column 1 Row 1 and Column 2 Row 1 and Column 3
    Input Input Result
    a c 1
    a d 5
    b d 2
    b c 4

    Your response will be highly appreciated

    Thanks with Regards,
    sathishrosario@gmail.com
    Attached Files Attached Files

+ 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