Formula to combine, if +index match

gaftalik

Well-known Member
Joined
Feb 6, 2003
Messages
521
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

I have the below table where as:


B4:G4 is the price per 2kgs (A4) for each city area
B6 is the additional price for each additional 2 kgs for every city.

Having A10:A27 as different weights, how can i look each weight of this range in its respective city and calculate the cost automatically with additional charges accordingly.

I have shown for CITY1 in B10:B27 what the results should be.

I appreciate very much your help.

Test.xls
ABCDEFGH
1
2
3WEIGHTKGCITY1CITY2CITY3CITY4CITY5CITY6
42$4.00$4.00$5.00$5.00$6.00$6.00
5
6Additionalchargeforeach2kgs$2.50$2.50$2.50$2.50$2.50$2.50
7
8
9WEIGHTKGCITY1CITY2CITY3CITY4CITY5CITY6
100.414
110.724
121.134
131.624
142.886.5
153.096.5
163.826.5
170.544
180.864
191.224
201.444
212.166.5
222.346.5
231.914
242.866.5
252.756.5
264.129
276.1811.5
28
29
30
Sheet1
 
do you mean this way ?
if so still the answer is different .

If+index match question.xls
HIJKLM
2
3WEIGHTKGCITY1
42$4.00
5
6Additionalchargeforeach2kgs$2.50
7
8RichardMGreen
9WEIGHTKGCITY1
100.4144
110.7244
121.1344
131.6244
142.886.56.5
153.096.56.5
163.826.56.5
170.5444
180.8644
191.2244
201.4444
212.166.56.5
222.346.56.5
231.9144
242.866.56.5
252.756.56.5
264.1299
276.1811.511.5
286.00911.5
29
30
Sheet1 (2)
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
=J$4+IF($A10+0.001>$A$4,(INT((INT($A10+0.001)/$A$4)))*J$6,0)

only add the +.001 to the first $A10
 
Upvote 0
I tried to add +0.001 to the first A4 it didnt work , tried it on second then both also didnt work !
 
Upvote 0
OK

Last try,

=ROUND(B$4,2)+IF($A10>$A$4,(INT((INT($A10)/$A$4)))*B$6,0)

if this does not work then click on the 6.00 in column I28 and tell us what it reads in the furmula box, the original formula works its your values that are wrong
 
Upvote 0
in I28 the number in the formula bar is simply 6 (there is no formula)
if the rule is for the first 2 kgs of weight the charge is 4$ and then for each additional 2 kgs the charge is 2.5$, having in I28 6kgs as a weight that means ==>
4$+(2x2.5$)= 9$ Total

For example if the weight is 2kgs you pay 4$
if the weight is 4kgs you pay 4$+2.5$
if the weight is 4.1 Kgs that means you have 2kgs+2kgs+2kgs => 4$ + (2x2.5$) that fraction of 0.1kgs already includes you in the 3rd additional 2 kgs and so on..

That is how courrier shipment companies charge you, and that should be solved in a formula.
 
Upvote 0
<TABLE style="WIDTH: 96pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=128><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 width=64 align=right>0.00</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" width=64 align=right>4</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>2.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>6.5</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>4.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>9</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>6.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>11.5</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>8.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>14</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>10.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>16.5</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" class=xl65 height=20 align=right>12.01</TD><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" align=right>19</TD></TR></TBODY></TABLE>


OK place this table in K2 and L2 and use the following formula in K10

=VLOOKUP(I10,$K$2$L$8,2,1)
 
Upvote 0
OK, try this one. I didn't realise the exact kilo weight (e.g. 10KG) would fall into the lower price bracket.

=B$4+IF($A10>$A$4,(INT((INT($A10-0.001)/$A$4)))*B$6,0)

10KG now gives $14.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,716
Members
452,939
Latest member
WCrawford

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