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

questforexcel

Board Regular
Joined
Jan 18, 2019
Messages
92
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.

01022-1174
01057-9616
01104-2628



<colgroup><col></colgroup><tbody>
</tbody>
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
6,791
maybe
Code:
=IFERROR(VLOOKUP(--LEFT(A98,3),'USPS - Zone & Rate Chart'!$B$4:$I$125,2,1),"")
no real example - not tested
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,109,349
Messages
5,528,188
Members
409,807
Latest member
nicky736

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top