Finding the correct formula for multiple ranges of zip codes to determine shipping cost.

bmccan20

New Member
Joined
Mar 6, 2019
Messages
6
I have several vertical ranges of zip codes with each range equaling a specific delivery cost. If I type the a zip code in one cell, I want the cell next to it to show the price of delivery. I have been successful with different formulas, but they have only worked with one range at a time. I can't get my multiple ranges nested correctly in the cell I want to display the cost. So basically I'm going about it this way, If this cell equals a number in this range, then return this value, if not return nothing. What would be the best way to approach this?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I have several vertical ranges of zip codes with each range equaling a specific delivery cost. If I type the a zip code in one cell, I want the cell next to it to show the price of delivery. I have been successful with different formulas, but they have only worked with one range at a time. I can't get my multiple ranges nested correctly in the cell I want to display the cost. So basically I'm going about it this way, If this cell equals a number in this range, then return this value, if not return nothing. What would be the best way to approach this?


Can you provide an example?
Seems like a pretty straight forward use of vlookup or index/match functions
 
Upvote 0
Sure...

=IF(COUNTIF(K3:K16,C32),100,"")
&
=IF(ISNA(MATCH(C32,K3:K16,0)),"",100)

C32 is where the initial zip code is entered, while 100 is the value I need to return for the delivery cost, but I have several ranges and price differences to add to this formula.

Both seem to work but I can't successfully add more ranges to the formula. I'm new to excel, so my knowledge it limited and my syntax is not fully realized.
 
Upvote 0
Try provide an example of the sheet you are working with and the associated formula.
Still a but tricky to work out what you want.
But here is what I think you want.

See example below
You have a list of zip codes and associated amounts (D1:E7)
You want to enter in a zip code in A2 to return the result in B2
If this is the case use =vlookup(A2,D2:E7,2,False) (be careful there are limits to using vlookup and index/match is a better function. But this will work)

[TABLE="width: 200"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Zip[/TD]
[TD]Amount[/TD]
[TD][/TD]
[TD]Zip[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4[/TD]
[TD]404[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]404[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD]600[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
417507_988a6ae5dc3841bb87549ed5e223ccb1~mv2.jpg
 
Upvote 0
Without getting too complicated, you can just continue what you are doing using more if functions.
Not the prettiest solution but it'll work. Then you can just repeat this for however many columns you want

=IF(COUNTIF(L3:L34,$C$32)=1,L2,(IF(COUNTIF(M3:M34,$C$32)=1,M2,(IF(COUNTIF(N3:N34,$C$32)=1,N2,IF(COUNTIF(K3:K34,$C$32)=1,K2,""))))))
 
Upvote 0
Try with this formula


Excel Workbook
ABCDEFGHIJKLMNOP
1SALESDelivery Charges
2100110120
3449014550146701
4449024550246702
5449034550346703
6449044550446704
7449054550546705
8449064550646706
9449074550746707
104550846708
114550946709
1246710
3046728
31DELIVERYZIP CODE46729
3245505110
Sheet
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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