<= > in a formula

Closed
Moe - 24 Feb 2010 à 16:51
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 24 Feb 2010 à 17:01
Hello,

I need to write a formula for the cost of a coach. For the first 100 miles I have to charge £1.20 and anything over 100 miles has to be charged at 90p. I was hoping to do this using <= and > so that I can copy the formula all down the worksheet. This I need to put in a formula that I already have driving time per hour, travelling time, time at destination, waiting time per hour but it is the mileage upto and over 100 miles I cant get to work.

Can anyone help please.

Thank you.

Kind regards,
Moe

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
24 Feb 2010 à 17:01
Use if statement

Lets say mileage is in cell A1 and cost needs to be in B1, then in B1 you can write

=IF(A1="","",IF(A1<=100,A1*1.2,(100*1.2)+(A1-100)*0.9))