Suppose, in Sheet1, I have an Order table
OrderNo. ShipmentNo. Rate
54321 AP2312
54321 AP2312
29781 AP2312
32181 AP2312
54321 AP2312
In sheet2, I have rate table
OrderNo. Rate
S4321 65
the below table is the end result which I am trying to get by applying some kind of lookup based on sheet2 rate table
OrderNo. ShipmentNo. Rate
54321 AP2312 65
54321 AP2312 0
29781 AP2312 NA
32181 AP2312 NA
54321 AP2312 0
which means, the formula should return the value against only first found result viz. 54321 in this case.
You may try this
On Sheet1 In C2
=IFERROR(IF(COUNTIF(A$2:A2,A2)=1,VLOOKUP(A2,Sheet2!A:B,2,0),0),"NA")
Edit: Or more correctly this
=IF(ISNUMBER(MATCH(A2,Sheet2!A:A,0)),IF(COUNTIF(A$2:A2,A2)=1,VLOOKUP(A2,Sheet2!A:B,2,0),0),"NA")
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments