Comparable Excel Formula?

L

Lee Hunter

The task is to calculate the elapsed time between two
values. The first is a scheduled time with no associated
date (1/0/00 13.20)i.e. the same time every day. The
second is an actual time with it's asociated date
(7/31/04 13:30). The difference is negative 10 minutes
or 10 minutes late

The formula which works in Access is:
Var: DateDiff("n",FormatDateTime(Date1,4),FormatDateTime
(date2,4))

Is there a comparable formula in Excel?
 
H

hgrove

Lee Hunter wrote...
The task is to calculate the elapsed time between two values.
The first is a scheduled time with no associated date (1/0/00
13.20) i.e. the same time every day. The second is an actual
time with it's asociated date (7/31/04 13:30). The difference is
negative 10 minutes or 10 minutes late
...

Maybe something like

=IF(Date1=MOD(Date2,1),"On Time",ABS(Date1-MOD(Date2,1))&
" minutes "&IF(Date1<MOD(Date2,1),"late","early"))

One difficulty in Excel is that Excel doesn't handle negative tim
easily or well. You can't use time number formats with negative tim
values. However, if all you want is the numeric result,

=Date1-MOD(Date2,1)

would work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top