Match Formula

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,601
Office Version
  1. 2021
Platform
  1. Windows
I have a spreadsheet with a number of account numbers. I also import account numbers and have set up a match formula to advise whether the account is "Found" or "Not Found"

Where the account number has an Alpha whithin the number the match formula gives me the correct result for Eg 10G551 gives a correct result.

However where there is a number with no Alpha character in the account number an incorrect result is given for eg account 107500 appears in B3, however the match formula comes up as "Not found"

I have attached sample data. Your assistance in resolving this problem will be most appreciated

Account Number Matching.xls
BCDE
3107500
4107700
5107823
6107510
7107710
80
9107501
10107511
11107590
1210G550
1310G568
1410G668
1510G580
1610G581
1710G554
1810G654
1910G558
2010G551
2110G566
2210G556
UV Sales



Account Number Matching.xls
ABCD
45107500NewAccount
46107510NewAccount
4710G551Found
UV Sales
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
=IF(LEN(A45)*COUNTIF($B$3:$B$32,A45),"Found","New Account")

Edit - just realised that's not exactly what you want. Try@
=IF(A45="","",IF(COUNTIF($B$3:$B$32,A45),"Found","New Account"))
 
Upvote 0
I have a spreadsheet with a number of account numbers. I also import account numbers and have set up a match formula to advise whether the account is "Found" or "Not Found"

Where the account number has an Alpha whithin the number the match formula gives me the correct result for Eg 10G551 gives a correct result.

However where there is a number with no Alpha character in the account number an incorrect result is given for eg account 107500 appears in B3, however the match formula comes up as "Not found"

I have attached sample data. Your assistance in resolving this problem will be most appreciated

Account Number Matching.xls
BCDE
3107500
4107700
5107823
6107510
7107710
80
9107501
10107511
11107590
1210G550
1310G568
1410G668
1510G580
1610G581
1710G554
1810G654
1910G558
2010G551
2110G566
2210G556
UV Sales



Account Number Matching.xls
ABCD
45107500NewAccount
46107510NewAccount
4710G551Found
UV Sales
Does...

=IF(A45="","",IF(ISNUMBER(MATCH(IF(ISNUMBER(A45+0),A45+0,A45),$B$3:$B$32,0)),"Found","New Account"))

resolve the problem?
 
Upvote 0
Hi Neil & Aladin

Thanks for the replies.

The solution provided by neil works perfectly.

Aladin, the Match formula for some unkown reason does not allways give the correct solution

If you want you can send me your email in a private message & I can email you my file so that you can test the data
 
Upvote 0
Hi Neil & Aladin

Thanks for the replies.

The solution provided by neil works perfectly.

Aladin, the Match formula for some unkown reason does not allways give the correct solution

If you want you can send me your email in a private message & I can email you my file so that you can test the data

Either...

=IF(A45="","",IF(ISNUMBER(MATCH(IF(ISNUMBER(A45+0),A45+0,A45),$B$3:$B$32,0)),"Found","New Account"))

Or...

=IF(A45="","",IF(ISNUMBER(MATCH(A45&"",$B$3:$B$32,0)),"Found","New Account"))

should work. Maybe not that relevant here, IsNumber/Match is faster than CountIf.
 
Upvote 0
Hi Aladin

Thanks for the help.

The formula =IF(A45="","",IF(ISNUMBER(MATCH(A45&"",$B$3:$B$32,0)),"Found","New Account")) works perfectly

What is the relevance of using match(A45&"" in this instance in terms of the lookup value?

Your assistance will be most appreciated
 
Upvote 0
Hi Aladin

Thanks for the help.

The formula =IF(A45="","",IF(ISNUMBER(MATCH(A45&"",$B$3:$B$32,0)),"Found","New Account")) works perfectly

What is the relevance of using match(A45&"" in this instance in terms of the lookup value?

Your assistance will be most appreciated

B3:B32 appears to house text numbers. The expression A45&"" makes the number in A45 a text number, which we can then match against the text number B3:B32. Othwerwise, matching true numbers against text numbers won't succeed. CountIf cannot distinguish them at all.
 
Upvote 0
Hi Aladin

Thanks for the explanation and for all your help

Regards

Howard
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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