Combining If/or and vlookup across multiple sheets

I have 4 sheets: NCR Summary sheet. Supplier A sheet, Supplier B sheet, and Supplier C sheet.

I want to pull information from individual supplier sheets to populate fields in the summary sheet. The summary sheet will already have the supplier name in a column and a unique identifier for each line in a column(NCR #).

I'm trying to build logic in a cell in the summary sheet that will use the Supplier name to know which sheet to reference and a vlookup to pull the specific data. i.e. Using the first line in the summary sheet shown below...To populate "Rejection Reason", the Supplier is "A", so go to sheet "Supplier A" and the NCR Number is "1", so return the value for row with NCR "1."

I can get a vlookup to work if I point the Rejection Reason cell specifically at the Supplier A sheet and return the value in the matching NCR row.

I cannot get it to use logic to determine which sheet reference to follow based on the value in the Supplier Name column.

I think I need something along the lines of:

=IF(OR(Supplier@row=A, (VLOOKUP([NCR Number]@row, {Supplier A Range 1}, 4)),"no data")), (OR(Supplier@row=B, (VLOOKUP([NCR Number]@row, {Supplier B Range 1}, 4)),"no data")),(OR(Supplier@row=C, (VLOOKUP([NCR Number]@row, {Supplier C Range 1}, 4)),"no data"))

Summary Sheet

One of the Supplier Sheets

Best Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    You don't need the OR function(s). It would just be a nested IF.

    =IF(Supplier@row = "A", VLOOKUP(supplier a sheet), IF(Supplier@row = "B", VLOOKUP(supplier b sheet), VLOOKUP(supplier c sheet)))

  • Monique_Odom_Comcast
    Monique_Odom_Comcast ✭✭✭✭✭
    Answer ✓

    Hello @Jim McWilliams,

    Instead of using the OR functions, I would suggest using sequential IF functions. Try this:

    =IF(Supplier@row="A", VLOOKUP([NCR Number]@row, {Supplier A Range 1}, 4), IF(Supplier@row="B", VLOOKUP([NCR Number]@row, {Supplier B Range 1}, 4), IF(Supplier@row="C", VLOOKUP([NCR Number]@row, {Supplier C Range 1}, 4),"no data")))

    Monique Odom

    Process Manager

    Smartsheet Automagician

    Pronouns: She/Her (What’s this?)

    “Take chances, make mistakes, get messy!” – Ms. Frizzle


Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!