View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
dk_ dk_ is offline
external usenet poster
 
Posts: 70
Default Why does this formula not work?

In article ,
"Roger Govier" wrote:

Hi Dennis

An alternative to adding 1 (24 hours) to values which are in the next 24
hour time period, is to use
=MOD(E8-D8,1)

--
Regards

Roger Govier


Rodger,

MOD does not work when the time end crosses the midnight hour.

Thanks.

-Dennis




"dk_" wrote in message
...
In article ,
"Biff" wrote:

I don't know why a negative number
is the result of, for example 9:00 PM minus 8:00 PM.

The only thing I can think of is that 8:00 PM is not really 8:00 PM.

Are these times calculated or manually entered? Test the 8:00 PM cell
to see
if it is 1.

Biff



I've got it...

When adding the times together, the simple formula does work, (I must
have had a typo somewhere), but when the time stamp crosses midnight,
then I get the ###'s. I see that it is because of a negative number. I
guess that Excel is reading 1:00 AM the next day, as actually a lower
number, and then it adds a 1. So when I add the (E8<D8) info, which
apparently results in 1 (TRUE, I guess), then the time fraction is a
positive number and everything works. I see that it works, but it is
confusing me.

I'm confused about totaling the time, because when a '1' is added, I
would thing that that should represent and additional 24 hours in
Excel's time counting; but it doesn't.

Thanks.

-Dennis




"dk_" wrote in message
...
In article ,
"Biff" wrote:

Excel cannot display negatives times.

Unless you use the 1904 date system but then that opens a giant
can of
worms!

Biff

I now understand why the ###'s, but I don't know why a negative
number
is the result of, for example 9:00 PM minus 8:00 PM.

-Dennis




"Fred Smith" wrote in message
...
It's because E8 is less than D8. That gives you a negative
number.
Excel
cannot display negatives times. In it's place, you get the
####'s

--
Regards,
Fred


"dk_" wrote in message
...

Why does this time formula *NOT work* if I leave out '(E8<D8)'?
The formula works normally when written as below...

=(E8<D8)+E8-D8

When I leave out '(E8<D8)', the cell shows #########
If I use any 'number' format, the number is a negative number.

The 'Start Time' is in cell D8.
Tne 'End Time' is in cell E8.


The formula works properly even if
the 'End Time' crosses into a new day.

-Dennis

--
Dennis Kessler
http://www.denniskessler.com/acupuncture