VLOOKUP and Zipcodes with ZEROS

Utradeshow

Well-known Member
Joined
Apr 26, 2004
Messages
800
Office Version
  1. 365
Hi all,

I am Using a zip program to find nearest zip code. Then I use a VLOOKUP to populate cells. I have to convert the result of the zip code program to work with the VLOOKUP. I tried using VALUE function which works on zips with the full 5 digits and doesn't work with the ZERO leading Zipcodes. Then the TEXT function works with the "ZERO" zips and not the regular zip codes???? Any Suggestions?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Copy of Rad One Delivery List with Agent (TEST2).xlsm
GHIJKL
619446#VALUE!#VALUE!1944618Hughes Relocation
707004#VALUE!#VALUE!0700417TTI Fairfield
1000 locations
Cell Formulas
RangeFormula
G6:G7G6=CDXClosestZip(E6,0,'Preferred Agents'!A$2:A$107)
H6:H7H6=CDXClosestZip(E6,4,'Preferred Agents'!#REF!)
I6:I7I6=CDXClosestZip(E6,8,'Preferred Agents'!#REF!)
J6:J7J6=TEXT(G6,"00000")
K6:K7K6=CDXDistance(E6,J6)
L6L6=VLOOKUP(J6,'Preferred Agents'!A:C,3,FALSE)
L7L7=IFERROR(VLOOKUP(J7,'Preferred Agents'!A:C,3,FALSE),"")



Ok, converted everything to text and it seems to be working now!!! Thank you Gentlemen!
 
Upvote 0
OK, that is your problem. You have a mixture of Numbers and Non-Numbers in column A on that sheet.
ALL the data needs to be of the same data type.

Where did this data come from?
How did it get populated?

Here is how you can fix it:
1. Highlight column A
2. Right-click on any cell in column, select Format Cells, then go to to the Number tab and choose "Text"
3. With column A still highlighted, go to the Data menu, and select "Text to Columns"
4. Hit the "Next" button two times until you get to Step 3
5. Select the "Text" radio button
6. Click "Finish"

Now all your values in column A should be Text.
Don't apply the VALUE function to any values at all on your other sheet, and the VLOOKUP formulas should work.
 
Upvote 0
Fix column A like I instructed in the last post, and it should resolve your issue.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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