I
I
Ivan Eliseev2022-02-15 20:34:00
excel
Ivan Eliseev, 2022-02-15 20:34:00

How to calculate late time in Google Sheets?

Hello!

There is a table in which the time interval is specified.
I want to make an automatic calculation according to the conditions:
If the arrival time (E3) is less than the beginning of the interval, (A3) then we display the text "Arrived earlier by: E3-C3"
If the arrival time (E3) is greater than the beginning of the interval (A3) but less than the end (B3) , display the text "Arrived on time"
If the arrival time (E3) is higher than the end of the interval (B3), display the text "Late to: E3-B3"

Collected for this formula:

ifs(E3<A3;"Раньше";E3<B3;"Вовремя";E3>B3;"Опоздали")


But it is not possible to put in the value "Earlier", "On time, "Late" a formula that will calculate how late you are.
For example, concat (Earlier on: e3-a3)

Tell me, is this possible?

620be3fce4318737687269.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2022-02-15
@ivaneliseeff

=ЕСЛИ(E3 < A3;СЦЕПИТЬ("Пришёл раньше на ";ЕСЛИ(ОКРУГЛВНИЗ(((ЧАС(A3)*60+МИНУТЫ(A3)) - (ЧАС(E3)*60+МИНУТЫ(E3)))/60) > 0;СЦЕПИТЬ(ОКРУГЛВНИЗ(((ЧАС(A3)*60+МИНУТЫ(A3)) - (ЧАС(E3)*60+МИНУТЫ(E3)))/60);"ч.");"");" "; ОСТАТ((ЧАС(A3)*60+МИНУТЫ(A3)) - (ЧАС(E3)*60+МИНУТЫ(E3));60);" мин."); ЕСЛИ(E3 > B3;СЦЕПИТЬ("Опоздал на ";ЕСЛИ(ОКРУГЛВНИЗ(((ЧАС(E3)*60+МИНУТЫ(E3)) - (ЧАС(B3)*60+МИНУТЫ(B3)))/60) > 0;СЦЕПИТЬ(ОКРУГЛВНИЗ(((ЧАС(E3)*60+МИНУТЫ(E3)) - (ЧАС(B3)*60+МИНУТЫ(B3)))/60);"ч.");"");" "; ОСТАТ((ЧАС(E3)*60+МИНУТЫ(E3)) - (ЧАС(B3)*60+МИНУТЫ(B3));60);" мин.");"Прибыл вовремя"))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question