I need to match variables in two columns

Martin Edward

New Member
Joined
Apr 20, 2011
Messages
3
I need to see if variables in column 1. Exist in column 2. I have been trying to make a formula using IF however i am stumped as to how i should continue. Does excel have the power to find if variables in one column exist in the other column

Any help`would be greatly appreciated



Column1 Column2
500008 SAP/0000500114
1002294 SAP/0000500114
500198 SAP/0000500114
500258 SAP/0000501525
3910 SAP/0000501525
500114 SAP/0000501525
501397 SAP/0001000452
1000229 SAP/0001004563
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I need to see if variables in column 1. Exist in column 2. I have been trying to make a formula using IF however i am stumped as to how i should continue. Does excel have the power to find if variables in one column exist in the other column

Any help`would be greatly appreciated



Column1 Column2
500008 SAP/0000500114
1002294 SAP/0000500114
500198 SAP/0000500114
500258 SAP/0000501525
3910 SAP/0000501525
500114 SAP/0000501525
501397 SAP/0001000452
1000229 SAP/0001004563
You can do something like this:

Book1
ABC
1FALSE500008SAP/0000500114
2FALSE1002294SAP/0000500114
3FALSE500198SAP/0000500114
4FALSE500258SAP/0000501525
5FALSE3910SAP/0000501525
6TRUE500114SAP/0000501525
7FALSE501397SAP/0001000452
8FALSE1000229SAP/0001004563
Sheet1

Array formula** entered in cell A1 and copied down:

=ISNUMBER(FIND(B1,C$1:C$8))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0
Try something like this...you'll have to change the b1-b5 values to search the actual number or rows.

=IF(ISERROR(VLOOKUP(a1,sheet1!$b$1:$b$5,1,FALSE)),"",VLOOKUP(a1,sheet1!$b$1:$b$5,2,FALSE))
 
Upvote 0
I need to see if variables in column 1. Exist in column 2. I have been trying to make a formula using IF however i am stumped as to how i should continue. Does excel have the power to find if variables in one column exist in the other column

Any help`would be greatly appreciated



Column1 Column2
500008 SAP/0000500114
1002294 SAP/0000500114
500198 SAP/0000500114
500258 SAP/0000501525
3910 SAP/0000501525
500114 SAP/0000501525
501397 SAP/0001000452
1000229 SAP/0001004563
Let the sample occupy A2:B9.

C2, copy down:

=ISNUMBER(MATCH("*"&A2&"*",$B$2:$B$9,0))+0

A 1 as result means a hit, a 0 non-hit
 
Upvote 0
Aladin Akyurek said:
Let the sample occupy A2:B9.

C2, copy down:

=ISNUMBER(MATCH("*"&A2&"*",$B$2:$B$9,0))+0

A 1 as result means a hit, a 0 non-hit
This will also return 1 or 0 without having to use a math operation to convert the logical TRUE or FALSE.

=COUNT(MATCH("*"&A2&"*",$B$2:$B$9,0))
 
Upvote 0
<table width="957" border="0" cellpadding="0" cellspacing="0"><col style="mso-width-source:userset;mso-width-alt:9033;width:185pt" width="247"> <col style="mso-width-source:userset;mso-width-alt:12178;width:250pt" width="333"> <col style="mso-width-source:userset;mso-width-alt:13787;width:283pt" width="377"> <tbody><tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;width:185pt" width="247" height="21">When using the following formula, column C shows a 1 when it is not supposed. to

=ISNUMBER(MATCH("*"A50&"*",$B$1:$B$154,0))+0




500008</td> <td class="xl71" style="width:250pt" width="333">




SAP/0000500114</td> <td style="width:283pt" width="377" align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1002294</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500114</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500198</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500114</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500258</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000501525</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">3910</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000501525</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl67" style="height:15.75pt;border-top:none" height="21"> </td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000501525</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">501397</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001000452</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1000229</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001004563</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500182</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001004563</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500146</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001004563</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500182</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500168</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl70" style="height:15.75pt;border-top:none" height="21">SPO0002 V090</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500168</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500158</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500168</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl68" style="height:15.75pt;border-top:none" height="21"> </td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000501621</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1000319</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000501621</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500126</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001003723</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1005377</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001004155</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500029</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001004155</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">5543 5372 500313</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001800086</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1002326</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001800086</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500226</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001800104</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500203</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001800210</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1800221 & 1800139</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001800210</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1000349</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001000388</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">501649</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001002710</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500536</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500420</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1800119</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500420</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500270</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001002937</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500120</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001001619</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500150</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001003012</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">FIR0001</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001003012</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">501670</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0001003012</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">501526</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500016</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500150</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500016</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500837</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500016</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">500039</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500016</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">501692</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500077</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1319</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500077</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1002128</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500090</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">1000380</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500113</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1000187</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500126</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500139</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500158</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl67" style="height:15.75pt;border-top:none" height="21">500115</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500158</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500215</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500158</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">501525</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500158</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">500066</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500165</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">5006</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500165</td> <td align="right">1</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1003602</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500165</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">1004218</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500176</td> <td align="right">0</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl66" style="height:15.75pt;border-top:none" height="21">501720 / 1000704</td> <td class="xl71" style="border-top:none;width:250pt" width="333">SAP/0000500176</td> <td align="right">0</td> </tr> </tbody></table>
 
Upvote 0
ANSWER TO BIFF

When i run this formula, i do not get the true value that you do :

=ISNUMBER(FIND(B5,C$1:C$154))

<table width="957" border="0" cellpadding="0" cellspacing="0"><col style="mso-width-source:userset;mso-width-alt:9033;width:185pt" width="247"> <col style="mso-width-source:userset;mso-width-alt:12178;width:250pt" width="333"> <col style="mso-width-source:userset;mso-width-alt:13787;width:283pt" width="377"> <tbody><tr style="height:15.75pt" height="21"> <td style="height:15.75pt;width:185pt" width="247" align="center" height="21">FALSE</td> <td class="xl66" style="width:250pt" width="333">1002294</td> <td class="xl69" style="width:283pt" width="377">SAP/0000500114</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl66" style="border-top:none">500198</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0000500114</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl66" style="border-top:none">500258</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0000500114</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl66" style="border-top:none">3910</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0000501525</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl67" style="border-top:none">500114</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0000501525</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl66" style="border-top:none">501397</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0000501525</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl68" style="border-top:none">1000229</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0001000452</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl68" style="border-top:none">500182</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0001004563</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" align="center" height="21">FALSE</td> <td class="xl68" style="border-top:none">500146</td> <td class="xl69" style="border-top:none;width:283pt" width="377">SAP/0001004563</td> </tr> </tbody></table>
 
Upvote 0
ANSWER TO BIFF

When i run this formula, i do not get the true value that you do :

=ISNUMBER(FIND(B5,C$1:C$154))

<TABLE cellSpacing=0 cellPadding=0 width=957 border=0><COLGROUP><COL style="WIDTH: 185pt; mso-width-source: userset; mso-width-alt: 9033" width=247><COL style="WIDTH: 250pt; mso-width-source: userset; mso-width-alt: 12178" width=333><COL style="WIDTH: 283pt; mso-width-source: userset; mso-width-alt: 13787" width=377><TBODY><TR style="HEIGHT: 15.75pt" height=21><TD style="WIDTH: 185pt; HEIGHT: 15.75pt" align=middle width=247 height=21>FALSE</TD><TD class=xl66 style="WIDTH: 250pt" width=333>1002294</TD><TD class=xl69 style="WIDTH: 283pt" width=377>SAP/0000500114</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl66 style="BORDER-TOP: medium none">500198</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0000500114</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl66 style="BORDER-TOP: medium none">500258</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0000500114</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl66 style="BORDER-TOP: medium none">3910</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0000501525</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl67 style="BORDER-TOP: medium none">500114</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0000501525</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl66 style="BORDER-TOP: medium none">501397</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0000501525</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl68 style="BORDER-TOP: medium none">1000229</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0001000452</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl68 style="BORDER-TOP: medium none">500182</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0001004563</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="HEIGHT: 15.75pt" align=middle height=21>FALSE</TD><TD class=xl68 style="BORDER-TOP: medium none">500146</TD><TD class=xl69 style="BORDER-TOP: medium none; WIDTH: 283pt" width=377>SAP/0001004563</TD></TR></TBODY></TABLE>
Did you enter the formula as an array?

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

On a side note...

That new sample data you posted doesn't look like the original sample data. The new data looks like it has multiple codes in some cells.

SPO0002 V090
5543 5372 500313
1800221 & 1800139
501720 / 1000704

If that's the case then none of the suggestions we made will work!
 
Upvote 0
Let A1:B50 house the data part of your exhibit...

In C1 enter and copy down:

=IF(A1="","",ISNUMBER(MATCH("*"&A1&"*",$B$1:$B$154,0))+0)
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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