If, Then formula [Solved/Closed]

Report
Posts
2
Registration date
Friday January 11, 2013
Status
Member
Last seen
January 14, 2013
-
Posts
2
Registration date
Friday January 11, 2013
Status
Member
Last seen
January 14, 2013
-
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 reply

Posts
2761
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
June 21, 2021
462
Hi Eaglewings,

Passengers are in A1.
Miles flown are in A2.

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

Best regards,
Trowa
Posts
2
Registration date
Friday January 11, 2013
Status
Member
Last seen
January 14, 2013

Thank you!!! That worked beautifully. You just saved me hours!

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!