Look up and Return Specified Value

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following table:

Column AColumn BColumn CColumn D
InvoiceStatusResultList
ABC123No MatchNo MatchGHT789
DEF456No MatchNo MatchHGR778
GHT789No MatchMatchBHG778

In column C, the formula should check the value in Column A against the value in Column D and if it is a match, to return as "Match". Otherwise, to return the value in column B. I tried using xlookup but I cant get it right. The correct result is in column C. Appreciate all the help
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Try one of these 3 methods:
Book1
ABCD
1InvoiceStatusResultList
2ABC123ABC123NO MATCHGHT789
3DEF456DEF456NO MATCHHGR778
4GHT789 MATCHBHG778
5JKL012JKL012NO MATCHSTZ001
6MNO345 MATCHVWW234
7PQR678PQR678NO MATCHMNO345
8STU901STU901NO MATCHPPP578
9VWX234VWX234NO MATCHJDR012
10YZA567 MATCHYZA567
11
12InvoiceStatusResultList
13ABC123ABC123 GHT789
14DEF456DEF456 HGR778
15GHT789 MATCHBHG778
16JKL012JKL012 STZ001
17MNO345 MATCHVWW234
18PQR678PQR678 MNO345
19STU901STU901 PPP578
20VWX234VWX234 JDR012
21YZA567 MATCHYZA567
22
23InvoiceStatusResultList
24ABC123ABC123 GHT789
25DEF456DEF456 HGR778
26GHT789 GHT789BHG778
27JKL012JKL012 STZ001
28MNO345 MNO345VWW234
29PQR678PQR678 MNO345
30STU901STU901 PPP578
31VWX234VWX234 JDR012
32YZA567 YZA567YZA567
33
Sheet2
Cell Formulas
RangeFormula
B2:B10B2=IF(C2="NO MATCH",A2,"")
C2:C10C2=IF(IFNA(INDEX($A$2:$A$10,MATCH(A2,$D$2:$D$10,0)),"")="","NO MATCH","MATCH")
B24:B32,B13:B21B13=IF(C13="",A13,"")
C13:C21C13=IF(IFNA(INDEX($A$2:$A$10,MATCH(A2,$D$2:$D$10,0)),"")="","","MATCH")
C24:C32C24=IF(IFNA(INDEX($A$2:$A$10,MATCH(A2,$D$2:$D$10,0)),"")="","",A2)
 
Upvote 0
Hi,

My apologies. I have an added criteria as follows:

Book2
ABCDEF
1InvoiceCodeStatusResultListList 2
2ABC123WHNo MatchMatchGHT78954
3DEF45610No MatchNo MatchHGR778JH
4GHT78911No MatchMatchBHG778WH
Sheet1


In column D:
1) If the value in column A matches any of the values in column E, return as Match, otherwise return the value from column C
2) If the value in column B matches any of the values in column F, return as Match, otherwise return the value from column C
3) As long as either one of the above is a match with their respective list in column E or F, to return as Match, otherwise return the value from column C

Example of the correct result is in column C. Is there a way to modify the existing formula ? I tried as below but did not work. Appreciate all the help.

Excel Formula:
=IF(COUNTIF($F$2:$F$5,B3),"Match",IF(COUNTIF($E$2:$E$5,A3),"Match",C3)*C3)
 
Upvote 0
Replace the last "*" by"," then it should works.
Or:
=IF(OR(COUNTIF($F$2:$F$5,B3),COUNTIF($E$2:$E$5,A3)),"Match",C3)
 
Upvote 0
Solution
Thank you bebo.

That worked. Appreciate your time and patience. Have a great day.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top