How to make Vlookup formula only a specific numbers in a range of data

questforexcel

Board Regular
Joined
Jan 18, 2019
Messages
128
Office Version
  1. 2013
Platform
  1. Windows
Hi,

Below are the numbers from which I want my vlookup formula to pick only the first 3 digits.

However, if there is a "0" in the beginning of the formula, I'd like it to only pick the next 2 digits after 0.

Could you please help me in this formula assessment.

Currently, I've used the formula =IFERROR(VLOOKUP(LEFT(A98,3),'USPS - Zone & Rate Chart'!$B$4:$I$125,2,1),"")

However, for the ranges starting with 0, it returns the blank value.

[TABLE="width: 89"]
<colgroup><col></colgroup><tbody>[TR]
[TD]01022-1174[/TD]
[/TR]
[TR]
[TD]01057-9616[/TD]
[/TR]
[TR]
[TD]01104-2628[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
maybe
Code:
=IFERROR(VLOOKUP(--LEFT(A98,3),'USPS - Zone & Rate Chart'!$B$4:$I$125,2,1),"")
no real example - not tested
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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