how to use If statement for times using Excel

February 18, 2011 at 10:55:11
Specs: N/A
Hello,
For the following times,
Time 1 Time 2
16:00 18:39
16:00 15:50
18:30 19:12
15:30 13:16
15:30 16:00
10:55 11:15
09:52 10:08
14:00 11:15

If (time 2) is greater than (time 1), then I want the difference… If not, I want the output to be zero...
I tried the following formula =IF(B2>A2,B2-A2,0)
but the output appears to be zero all the time and I wonder why…
if anyone could help me, I would really appreciate it..
thanks


See More: how to use If statement for times using Excel

Report •

#1
February 18, 2011 at 12:06:40
Works for me:

Time 1	Time 2	 Diff
16:00	18:39	2:39
16:00	15:50	0:00
18:30	19:12	0:42
15:30	13:16	0:00
15:30	16:00	0:30
10:55	11:15	0:20
 9:52   10:08	0:16
14:00	11:15	0:00

If your seeing this:

Time 1	Time 2	
16:00	18:39	0.110416667
16:00	15:50	0
18:30	19:12	0.029166667
15:30	13:16	0
15:30	16:00	0.020833333
10:55	11:15	0.013888889
9:52	10:08	0.011111111
14:00	11:15	0

Then Custom Format your totals to [H]:MM

MIKE

http://www.skeptic.com/


Report •
Related Solutions


Ask Question