Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can anyone help me with a Formula

Hi.
I'd appreciate it if some kind soul out there can work out a formula for me.
I've spent weeks trying to fathom one out but all I do is end up pulling my
hair out.
Ok I need a formula that will do the following:-

24hr clock times between and column C to calculate total hours

Column A Column B Column C
18.00 20.00 2
05.15 07.30 2.25
21.00 02.00 5
10.30 11.15 0.75
06.00 18.00 12
etc.etc.etc.

I'd appreciate any help that will help me solve the problem

Thanks in anticipation

Dick Smith






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can anyone help me with a Formula

Hi Dick,

In C1

=MOD(B1-A1,1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dick Smith" wrote in message
...
Hi.
I'd appreciate it if some kind soul out there can work out a formula for

me.
I've spent weeks trying to fathom one out but all I do is end up pulling

my
hair out.
Ok I need a formula that will do the following:-

24hr clock times between and column C to calculate total hours

Column A Column B Column C
18.00 20.00 2
05.15 07.30 2.25
21.00 02.00 5
10.30 11.15 0.75
06.00 18.00 12
etc.etc.etc.

I'd appreciate any help that will help me solve the problem

Thanks in anticipation

Dick Smith








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Can anyone help me with a Formula

Hi Dick,
Worksheet solution:
C2: =(B2-A2+(A2B2))*24

There are 24 hours is a day. Time is a fraction of a day.
So a datetimestamp takes nor more space than either alone.

The B1B2 is a logical it returns 0 if false and 1 if true.
Add 24 hours if A2B2.

Of course you could the same type of logic in a program
(macro) if your really want to.

You could subtract them as times without multiplying
by 24 and format the result as time [h]:mm:ss
the [h] is more useful for totals and keeps hours
from overflowing into days.

More information on Date and Time at
http://www.mvps.org/dmcritchie/excel/datetime.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Dick Smith" wrote in message ...
Hi.
I'd appreciate it if some kind soul out there can work out a formula for me.
I've spent weeks trying to fathom one out but all I do is end up pulling my
hair out.
Ok I need a formula that will do the following:-

24hr clock times between and column C to calculate total hours

Column A Column B Column C
18.00 20.00 2
05.15 07.30 2.25
21.00 02.00 5
10.30 11.15 0.75
06.00 18.00 12
etc.etc.etc.

I'd appreciate any help that will help me solve the problem

Thanks in anticipation

Dick Smith









  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Can anyone help me with a Formula

Hi, I've done this before and will work on it but
basically what you need to do separate the hours and the
minutes by using left() and right() functions. You will
also need to test the minutes result and adjust your
calculation depending on whether the column B minutes
piece is less than that of column A.

John
-----Original Message-----
Hi.
I'd appreciate it if some kind soul out there can work

out a formula for me.
I've spent weeks trying to fathom one out but all I do is

end up pulling my
hair out.
Ok I need a formula that will do the following:-

24hr clock times between and column C to calculate total

hours

Column A Column B Column C
18.00 20.00 2
05.15 07.30 2.25
21.00 02.00 5
10.30 11.15 0.75
06.00 18.00 12
etc.etc.etc.

I'd appreciate any help that will help me solve the

problem

Thanks in anticipation

Dick Smith






.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can anyone help me with a Formula

Multiply my answer by 24 to get the style you wan t, that is decimal hours

=MOD(B1-A1,1)*24

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Hi Dick,

In C1

=MOD(B1-A1,1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dick Smith" wrote in message
...
Hi.
I'd appreciate it if some kind soul out there can work out a formula for

me.
I've spent weeks trying to fathom one out but all I do is end up pulling

my
hair out.
Ok I need a formula that will do the following:-

24hr clock times between and column C to calculate total hours

Column A Column B Column C
18.00 20.00 2
05.15 07.30 2.25
21.00 02.00 5
10.30 11.15 0.75
06.00 18.00 12
etc.etc.etc.

I'd appreciate any help that will help me solve the problem

Thanks in anticipation

Dick Smith










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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 03:29 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"