<= > in a formula

Closed
Moe - Feb 24, 2010 at 04:51 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 24, 2010 at 05:01 PM
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 January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 24, 2010 at 05:01 PM
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))
0