Google-sheets – Blank Box If No Data Inputted

formulasgoogle sheetsgoogle-sheets-arrayformula

This might sound hugely amateurish but I have a spreadsheet for my Pilot Log Book as I am a student. I have boxes stating my Take Off time and Landing time. In this case:

13:40 (H5) to 14:40 (I5)

This means I would put down 1:00 (K5) for the amount flown.

What formula would I input to say "I5 – H5 =", but if there is no value in I5 or H5, leave K5 blank?

Best Answer

=IF(AND(H5<>"", I5<>""), I5-H5, )

0


=ARRAYFORMULA(IF((H5:H<>"") * (I5:I<>""), TEXT(I5:I-H5:H, "hh:mm"), ))

0