Incorrect value picked up in Vlookup across multiple columns in one formula

questforexcel

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

I was trying to vlookup my data from a table with 4 columns, when I applied the following formula there were errors in a few of the calculations.

IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,2,1),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,4,1),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,6,1),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,8,1),"Not Found"))))

However, when I place all data in one single column, it picks the right values and figures.

Could you please help me to solve this.


I would like it to pick the values from the 4 column table and pick the right ones.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Im pretty sure that any of the lookups after the first are irrelevant. If the first one error's so will all the rest.

What im assuming your trying to do is.... if column 2 returns nothing the check column 4, if column 4 returns nothing then check column 6 etc??

If not i think we need more of an explanation.
 
Last edited:
Upvote 0
try change the option to 0 for all the vlookup

Code:
IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,2,[COLOR="#FF0000"]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,4,[COLOR="#FF0000"]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,6,[COLOR="#FF0000"]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,8,[COLOR="#FF0000"]0[/COLOR]),"Not Found"))))
 
Upvote 0
Hi,

Thats what I am trying to do.

If not in Column 2, find in Column 4, if not in Column 6, then find in Column 8, if nothing than return 0.

Could you please help me with this.

Thank you

Im pretty sure that any of the lookups after the first are irrelevant. If the first one error's so will all the rest.

What im assuming your trying to do is.... if column 2 returns nothing the check column 4, if column 4 returns nothing then check column 6 etc??

If not i think we need more of an explanation.
 
Upvote 0
I want my vlookup to pick values from a mixed pool of data.

Some are individual numbers eg. 102 , while some are ranges eg. 90-105, 106-120 etc

I would like my formula to show where my individual value falls within any of these ranges

try change the option to 0 for all the vlookup

Code:
IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,2,[COLOR=#FF0000]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,4,[COLOR=#FF0000]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,6,[COLOR=#FF0000]0[/COLOR]),IFERROR(VLOOKUP(LEFT(A4007,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,8,[COLOR=#FF0000]0[/COLOR]),"Not Found"))))
 
Upvote 0
could you post a small sample of the data here
 
Upvote 0
Sure, below is a sample of the data.

I would like each individual cell to mentioned in "Postal Code" below to be drawn from the list of ranges mentioned in "Zip Code" "Zone" below.


Postal Code
2575
7632
9314

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


ZIP CodeZoneZIP CodeZone
005-07663491*
775350---3524
078---0796354---3684
080---0875369---3945
088---08963954
090---0986+396---3975
100---14963984*
150---16653994
1676400---4185
168---2125420---4275
214---2685430---4335
270---2795434---4366
280---2854437---4625

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

IFERROR(VLOOKUP(LEFT(A6,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,2,1),IFERROR(VLOOKUP(LEFT(A6,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,4,1),IFERROR(VLOOKUP(LEFT(A6,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,6,1),IFERROR(VLOOKUP(LEFT(A6,3),'USPS - Zone & Pricing Chart'!$B$4:$I$34,8,1),"Not Found"))))

could you post a small sample of the data here
 
Upvote 0
so, what do you expect to get, e.g. Postal Code 2575?
 
Upvote 0
So based on the first 3 digits of the postal code, i would like it to display which zone does it fall under.

So 257 should fall under Zone 5, which is correct.

The problem is with the 2nd postal code, 7632. It should fall under Zone 6, but my formula displays it as Zone 2.

Is there a better way that I could reference my data to pull out from different columns at once.

Thank you

ZIP CodeZoneZIP CodeZone
005-07663491*
775350---3524
078---0796354---3684
080---0875369---3945
088---08963954
090---0986+396---3975
100---14963984*
150---16653994
1676400---4185
168---2125420---4275
214---2685430---4335
270---2795434---4366
280---2854437---4625
2865463---4686
287---3064469---4795
3075480---5096
308---3124510---5137
313---3153*514---5166
316---3174*520---5286
318---3194530---5326
3203*534---5356
3212*537---5396
3223*5407
323---3254*541---5456
3263*5467
327---3332*547---5496
3341*550---5517
335---3422*553---5677
3443*570---5777
346---3472*580---5887

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



so, what do you expect to get, e.g. Postal Code 2575?
 
Upvote 0
Hi,
If not in Column 2, find in Column 4, if not in Column 6, then find in Column 8, if nothing than return 0.

My suggestion is to modify your "USPS - Zone & Pricing Chart" to have two columns instead of 8. Take the data of columns C&D and put under A&B, likewise with E&F and G&H

Code:
=INDEX([COLOR=#574123][I]'USPS - Zone & Pricing Chart'![/I][/COLOR]$B$2:$B$181,MATCH(LEFT(A4007,3),[COLOR=#574123][I]'USPS - Zone & Pricing Chart'![/I][/COLOR]$A$2:$A$181,1))
Note: change 181 to be the last row of your concatenated columns of 'USPS - Zone & Pricing Chart'
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

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