#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default time problems

I have a spread sheet and in this sheet i have a set time that it takes to do
a run ie 01:30 1 hour 30 mins (A1)
then i have another cell that i input a time (A2) and a 3rd cell that has
an if function that says =if( a20, a2-a1,"") this works fine untill the time
difference goes back past midnight, if A2 = 01:00 and A1= 01:30 then i get
###### instead of 23:30, in lotus 123 it worked fine but excel seems to have
a problem with this, any ideas what i am doing wrong ?



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default time problems

=MOD(A2-A1,1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Stan Halls" wrote in message
...
I have a spread sheet and in this sheet i have a set time that it takes to

do
a run ie 01:30 1 hour 30 mins (A1)
then i have another cell that i input a time (A2) and a 3rd cell that has
an if function that says =if( a20, a2-a1,"") this works fine untill the

time
difference goes back past midnight, if A2 = 01:00 and A1= 01:30 then i get
###### instead of 23:30, in lotus 123 it worked fine but excel seems to

have
a problem with this, any ideas what i am doing wrong ?





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default time problems

Hi!

Try this:

=IF(A20,A2-A1+(A2<A1),"")

Format the cell as TIME 13:30 or CUSTOM h:mm

One thing of note, you're testing cell A2 against 0. What if A2 = 12:00 AM
which is equal to zero? Maybe you want this instead:

=IF(ISNUMBER(A2),A2-A1+(A2<A1),"")

Biff

"Stan Halls" wrote in message
...
I have a spread sheet and in this sheet i have a set time that it takes to
do
a run ie 01:30 1 hour 30 mins (A1)
then i have another cell that i input a time (A2) and a 3rd cell that has
an if function that says =if( a20, a2-a1,"") this works fine untill the
time
difference goes back past midnight, if A2 = 01:00 and A1= 01:30 then i get
###### instead of 23:30, in lotus 123 it worked fine but excel seems to
have
a problem with this, any ideas what i am doing wrong ?





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default time problems

Bob
I am not very good at this excel , is the =mod function able to be used
within an if function so that if there is no time in cell A2 then i get a
blank cell


"Bob Phillips" wrote:

=MOD(A2-A1,1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Stan Halls" wrote in message
...
I have a spread sheet and in this sheet i have a set time that it takes to

do
a run ie 01:30 1 hour 30 mins (A1)
then i have another cell that i input a time (A2) and a 3rd cell that has
an if function that says =if( a20, a2-a1,"") this works fine untill the

time
difference goes back past midnight, if A2 = 01:00 and A1= 01:30 then i get
###### instead of 23:30, in lotus 123 it worked fine but excel seems to

have
a problem with this, any ideas what i am doing wrong ?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default time problems

Bob
have sorted it out, thanks for the help to all of you that posted,
=IF(ISNUMBER(a2),MOD(a2-a1,1),"") this worked for me

"Bob Phillips" wrote:

=MOD(A2-A1,1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Stan Halls" wrote in message
...
I have a spread sheet and in this sheet i have a set time that it takes to

do
a run ie 01:30 1 hour 30 mins (A1)
then i have another cell that i input a time (A2) and a 3rd cell that has
an if function that says =if( a20, a2-a1,"") this works fine untill the

time
difference goes back past midnight, if A2 = 01:00 and A1= 01:30 then i get
###### instead of 23:30, in lotus 123 it worked fine but excel seems to

have
a problem with this, any ideas what i am doing wrong ?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
elapsed time problems MeredithS Excel Worksheet Functions 0 April 4th 06 08:57 PM
Hot key for time? Dave in Des Moines New Users to Excel 2 March 24th 06 04:31 PM
Hot key for time? Dave in Des Moines Excel Worksheet Functions 2 March 24th 06 04:15 PM
Hot key for time? Dave in Des Moines Excel Discussion (Misc queries) 1 March 24th 06 03:46 PM
time sheet to calculate 2 different columns John Sullivan Excel Worksheet Functions 1 October 21st 05 06:48 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"