• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need Help with Vlookup Formula

gmfston

New Member
Hello Ninjas,

I am looking for a formula that will populate the values from column C (sheet 2) to column C (sheet 1) if it finds matching data in both columns A & B in sheet 1 and sheet 2. If it does not find matching values in columns A & B, then populate column C, if columns B match in sheets 1 and 2.

Thank you in advance for your assistance.

Best regards,
Gina
 

Attachments

  • chandoo position category.xlsx
    16.3 KB · Views: 12
perhaps:
helper column in sheet 2 in E, concatenating columns A & B and then
=IFERROR(INDEX(Sheet2!$C$2:$C$61,MATCH(A2&"-"&B2,Sheet2!$E$2:$E$61,0)),VLOOKUP(B2,Sheet2!$B$2:$C$61,2,FALSE))
 

Attachments

  • Copy of chandoo position category.xlsx
    18.4 KB · Views: 10
Last edited:
Hi Try this in Sheet1 C2 (Ctrl+shift+enter)

=INDEX(Sheet2!$C$2:$C$61,MATCH(1,(Sheet2!$A$2:$A$34=Sheet1!A2)*(Sheet2!$B$2:$B$34=Sheet1!B2),0))
 

Attachments

  • chandoo position category1.xlsx
    16.8 KB · Views: 5
perhaps:
helper column in sheet 2 in E, concatenating columns A & B and then
=IFERROR(INDEX(Sheet2!$C$2:$C$61,MATCH(A2&"-"&B2,Sheet2!$E$2:$E$61,0)),VLOOKUP(B2,Sheet2!$B$2:$C$61,2,FALSE))
Thank you G. Unfortunately, I cannot concatenate the columns on my spreadsheet or it will corrupt all my other formulas on the spreadsheet that were not displayed but I do appreciate your assistance.

Thank you,
Gina
 
Gina, you can replace the helper column with a virtual range in the name manager.
rKey = Sheet2!$A$2:$A$61&"-"&Sheet2!$B$2:$B$61

Formula on Sheet 1 in C1: =Sheet2!$C$2:$C$61,MATCH(A2&"-"&B2;rKey,0))
But 1 question for row 7, what is the expected result?
This one returns ADM (since there is only a dpt value), whereas the previous one returned PHD, the first lookup value.
 

Attachments

  • Copy of Copy of chandoo position category.xlsx
    17.6 KB · Views: 4
Back
Top