Excel vlookup help

前端 未结 2 540
死守一世寂寞
死守一世寂寞 2021-01-15 23:41

Using vlookup, when a match occurs, I want to display the value of column C from sheet 2 from the same row where the match occurred. The formula I came up with takes the val

相关标签:
2条回答
  • 2021-01-16 00:18

    To be clear, I am not entirely certain I understand what you are trying to achieve. Maybe the following helps...

    Suppose I have 3 sheets in a workbook as follows:

        Sheet1            Sheet2                 Sheet3
        A                 A    B    C            A     B
    1   10                2    h    Apple        10    Apple
    2   20                g    4    Banana       25    n/a
    3   30                l    !    Pear         40    Grape
    4   40                g    *    Grape        30    Pear
    

    In column B of Sheet 3 I have the following formula:

    =INDEX(Sheet2!$C$1:$C$4,MATCH(VLOOKUP(A1,Sheet1!$A$1:$A$4,1,FALSE),Sheet1!$A$1:$A$4,1))
    

    To explain:

    • The VLOOKUP looks up the value from Sheet 3, Col A in Sheet1
    • The MATCH returns the row in Sheet1 of the VLOOKUP result
    • The INDEX then uses the row number to pick the right value from the value in Sheet2

    Again, not sure if this is what you wanted exactly. It may help you get you started...

    0 讨论(0)
  • 2021-01-16 00:33

    You need to manually get the index you're looking for, then get the value at that index:

    =INDEX(Sheet2!C:C, MATCH(Sheet1!A:A,Sheet2!A:A,FALSE))
    
    0 讨论(0)
提交回复
热议问题