Look for 3 first digits in a list of strings

ShayAA

New Member
Joined
Apr 13, 2017
Messages
6
Hi,

I have a list of Zip Codes, and a list of 3 first digits to look for in the zip code. I'm having a hard time writing the formula to achieve it.

Please see the attached image as an example of what I'm looking for.

Thanks!

IxPMAyJ.png
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Cannot view your image, can you post a small sample here?

However, probably something like=match(A2&"*",B:B,0)
 
Upvote 0
ShayAA,

Try pasting this formula in cell B2, and copying it down. Should be exactly what you want! This formula will also allow you to add or remove digits to look for in column D automatically. So you can look for less digit groups or more, just enter them as you please. Please let me know if you try this and/or it works for you.
Code:
=IF(IFERROR(VLOOKUP(LEFT(A2,3),OFFSET($D$2,0,0,COUNTA($D:$D)-1),1,FALSE),FALSE)=FALSE,FALSE,TRUE)

Brian

Brian J. Torreano
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,999
Members
452,373
Latest member
TimReeks

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