If, Then formula

Solved/Closed
eaglewings1983 Posts 2 Registration date Friday 11 January 2013 Status Member Last seen 14 January 2013 - 14 Jan 2013 à 08:40
eaglewings1983 Posts 2 Registration date Friday 11 January 2013 Status Member Last seen 14 January 2013 - 14 Jan 2013 à 10:25
Hello,

I am creating a spreadsheet for the company airplane. Part of it is to calculate how many of the miles flown were "occupied" (had passengers). I need to do this for each leg of the flight.

so leg 1 had 300 miles and 2 passengers. Occupied miles would be 300*2=600.
However, if there were no passengers, than the occupied miles is equal to the miles in the leg, or 300.

I need says if passengers is 0 than occupied miles = leg miles but if passengers is greater than 0 than multiply the leg miles by the passengers.

If anyone knows of a way to do this I would be so grateful.
Thank you!



1 response

TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 555
14 Jan 2013 à 10:18
Hi Eaglewings,

Passengers are in A1.
Miles flown are in A2.

Formula:
=IF(A1=0,A2,A1*A2)

Best regards,
Trowa
eaglewings1983 Posts 2 Registration date Friday 11 January 2013 Status Member Last seen 14 January 2013
14 Jan 2013 à 10:25
Thank you!!! That worked beautifully. You just saved me hours!