# IF calculation of Time

J

#### Jacarutu

A B C D E
Arrived Triage Triage Delay Doctor Doctor Delay
10:02 10:02 00:00 10:02 00:00
11:08 11:08 00:00 12:50 01:42
13:59 13:25 00:41 15:30 00:50
15:45 16:55 01:10 01:12 08:17
16:14 No Triage
16:21 16:25 00:04 17:50 01:25
16:27 16:35 00:08 17:00 00:25
16:37 17:15 00:38 19:55 02:40
17:36 17:55 00:19 22:00 04:05
17:39 19:00 01:21 21:25 02:25
18:39 19:45 01:06 21:40 01:55
19:19 19:40 00:21 20:40 01:00
23:17 23:30 00:13 00:45

I am looking for a formula which calculates the length of delay at Triage
and the delay waiting to see a Doctor in the Emergency Room after Triage.
This then inputs text if Triage was not carried out i.e. an emergency
admission which went straight to the Doctor because they were not breathing.

I also have oddities where the Triage occurs before arrival. This is
because the patient is rushed into Triage and a relative registers the
patient. I can also have patients who do not see either Triage or the Doctor
as they go straight to Surgery but I haven't even sarted to look at this yet
as I can't get my formula to work.

It is not putting an N/A into the cell where the triage was not carried out.
and is putting the ? instead. I wanted the ? to show where the triage
occured before arrival.

=IF(A1>B1,"?",IF(B1>0,B1-A1,"N/A"))

=IF(C1>D1,"NO TRIAGE",IF(D1>0,D1-B1,"N/A"))

I also need to consider the clock ticking past midnight i.e patient arrives
at 22:30 but is seen by the Doctor at 01:30. The calculation does not work
as I wanted as it does not recognise that it is the following day.

I stored 24:00 in cell O7 and tried to adapt my existing formula by adding
another IF:

=IF(C1>D1,"NO TRIAGE",IF(D1>0,D1-B1,"N/A",if (C1>D1,C1-\$O\$7+D1,"N/A")))

My theory was if I take 24:00 from the triage time, then add the time seen
by the Doctor it would give a delay time from Triage to Doctor where the
clock has passed into the following day.

You can tell I am not an expert. There is a date column which shows 28
September as 28.09. The problem I guess is that the patient arrives on the
28th but is not seen until the 29th.

It is not working anyhow and I need some advice please. If you could give
some thought to a patient going straight to Surgery as well it would be much
appreciated.

To cope with time going past midnight, change B1-A1 to MOD(B1-A1,1) and
change D1-C1 to MOD(D1-C1,1)

Hi

Maybe
in C2
=IF(D2=B2,"Straight to Doctor",IF(B2="No Triage","",
IF(A2>B2,"Immediate",IF(B2>0,MOD(B2-A2,1),"N/A"))))

in E2
=IF(AND(ISNUMBER(C2),C2>D2),"NO TRIAGE",IF(D2>0,MOD(D2-B2,1),"N/A"))

--
Regards
Roger Govier

Jacarutu said:
A B C D E
Arrived Triage Triage Delay Doctor Doctor Delay
10:02 10:02 00:00 10:02 00:00
11:08 11:08 00:00 12:50 01:42
13:59 13:25 00:41 15:30 00:50
15:45 16:55 01:10 01:12 08:17
16:14 No Triage
16:21 16:25 00:04 17:50 01:25
16:27 16:35 00:08 17:00 00:25
16:37 17:15 00:38 19:55 02:40
17:36 17:55 00:19 22:00 04:05
17:39 19:00 01:21 21:25 02:25
18:39 19:45 01:06 21:40 01:55
19:19 19:40 00:21 20:40 01:00
23:17 23:30 00:13 00:45

I am looking for a formula which calculates the length of delay at Triage
and the delay waiting to see a Doctor in the Emergency Room after Triage.
This then inputs text if Triage was not carried out i.e. an emergency
admission which went straight to the Doctor because they were not
breathing.

I also have oddities where the Triage occurs before arrival. This is
because the patient is rushed into Triage and a relative registers the
patient. I can also have patients who do not see either Triage or the
Doctor
as they go straight to Surgery but I haven't even sarted to look at this
yet
as I can't get my formula to work.

It is not putting an N/A into the cell where the triage was not carried
out.
and is putting the ? instead. I wanted the ? to show where the triage
occured before arrival.

=IF(A1>B1,"?",IF(B1>0,B1-A1,"N/A"))

=IF(C1>D1,"NO TRIAGE",IF(D1>0,D1-B1,"N/A"))

I also need to consider the clock ticking past midnight i.e patient
arrives
at 22:30 but is seen by the Doctor at 01:30. The calculation does not
work
as I wanted as it does not recognise that it is the following day.

I stored 24:00 in cell O7 and tried to adapt my existing formula by adding
another IF:

=IF(C1>D1,"NO TRIAGE",IF(D1>0,D1-B1,"N/A",if (C1>D1,C1-\$O\$7+D1,"N/A")))

My theory was if I take 24:00 from the triage time, then add the time seen
by the Doctor it would give a delay time from Triage to Doctor where the
clock has passed into the following day.

You can tell I am not an expert. There is a date column which shows 28
September as 28.09. The problem I guess is that the patient arrives on
the
28th but is not seen until the 29th.

It is not working anyhow and I need some advice please. If you could give
some thought to a patient going straight to Surgery as well it would be
much
appreciated.

__________ Information from ESET Smart Security, version of virus
signature database 4533 (20091022) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4533 (20091022) __________

The message was checked by ESET Smart Security.

http://www.eset.com