In the cell A2
, there is the timestamp, say 21:35, I'd like to calculate the remaining time to midnight.
It's essentially, 24 hours minus 21:35. But I want to have a formula for the calculation.
I found that if I put 24:00 in a cell, B1
, then the formula below works:
=B1-A2
but I'd like to have a formula without reference to another cell for the 24:00 constant? I guess there might be a way to express the constant of 24:00 as the duration in formula?
try simply:
="24:00:00"-A1
for ArrayFormula try:
=ARRAYFORMULA(IF(A1:A; TEXT("24:00:00"-A1:A; "hh:mm"); ))