Formula to calculate price per +0,5kg

IwanGerbes

New Member
Joined
Aug 21, 2015
Messages
9
Hi,
Guess it is an easy one, and sorry if it is already here, but couldn´t find it, as i don´t exactly now how to formulate it.
I´m searching for a formula to calculate in the following way:
Geography

<tbody>
</tbody>
Upto 500 gms

<tbody>
</tbody>
Every additional 500 gms

<tbody>
</tbody>
Within-city

<tbody>
</tbody>
30

<tbody>
</tbody>
25
Regional (<500Kms)

<tbody>
</tbody>
3630
Metro-Metro

<tbody>
</tbody>
3835
Rest of country

<tbody>
</tbody>
4239
North East, South East

<tbody>
</tbody>
5544

<tbody>
</tbody>


<colgroup><col><col><col></colgroup><tbody>
</tbody>
So if a shipment is 4,8 kg in Regional, it is 36 + 9x 30.
Is there a formula, which could do this? Or should i make an hidden sheet and do vlookup based on the weight to find the matching number?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Iwan,

Assuming that your table is pasted into cells A1:C6 (where column A is "Geography", column B is "upto 500 gms" and column C is "Every additional 500 gms"), you could do the following:

In cell E9, Specify the region that you are currently analyzing:
Regional (<500Kms)

Write the amount in cell F8:
4.8

Paste the following formula into cell F9:
=INDEX(B1:B6,MATCH(E9,A1:A6,0))+IF(F8>0.5,ROUNDUP((F8-0.5)/0.5,0)*INDEX(C1:C6,MATCH(E9,A1:A6,0)),0)

The final result should be 306.

Just to break it down:
INDEX(B1:B6,MATCH(E9,A1:A6,0))
returns the value for the first 500 gms (36)
ROUNDUP((F8-0.5)/0.5,0)
returns the value of 9 (4.8 - 0.5 divided by 0.5 is 8.6, and we are rounding it up to 9)
INDEX(C1:C6,MATCH(E9,A1:A6,0))
returns the unit value for each additional 500gms (30)
We also want to make sure that for the first 500gms we only get the value of 36, thus the IF statement in the second part of the formula:
IF(F8>0.5,...,0)

Let me know if you have any comments. I hope this is a good starting point.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,497
Messages
6,125,155
Members
449,208
Latest member
emmac

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