Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calculate hours from 10:00-21:00 format

Hello!

mr Somebody has a several worksheets wich includes lots of cells which
has start and end hours in format 10:00-18:00, 13:15-21:15 etc...

Cells are formatted as text.

He asked me if it's possible to calculate hours between start and
end hours automaticly. I check out macros and notice that java, php
and few other programming languages does not help me now.

I notice that if end hour is before start hour calculation works but
not vice versa.

How can i split string into two pieces and calculate it to other cell.

Let's say cell X includes string "10:00-20:00", I split it to Array
whics becomes 2 dimension arr and then calc cell Y value =
Array2-Array1.

Is there function to evaluate text cells???

I think this is possible but how????????

Advanced Super Thanx
-jori luoto
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Calculate hours from 10:00-21:00 format

Hi
why not split these values in two columns. Use 'Data - Text to columns'
for this. Afterwards simply subtract the values with a formula like
=B1-A1

and if your time values can span midnight use
=B1-A1+(B1<A1)


--
Regards
Frank Kabel
Frankfurt, Germany


Jorch wrote:
Hello!

mr Somebody has a several worksheets wich includes lots of cells

which
has start and end hours in format 10:00-18:00, 13:15-21:15 etc...

Cells are formatted as text.

He asked me if it's possible to calculate hours between start and
end hours automaticly. I check out macros and notice that java, php
and few other programming languages does not help me now.

I notice that if end hour is before start hour calculation works but
not vice versa.

How can i split string into two pieces and calculate it to other

cell.

Let's say cell X includes string "10:00-20:00", I split it to Array
whics becomes 2 dimension arr and then calc cell Y value =
Array2-Array1.

Is there function to evaluate text cells???

I think this is possible but how????????

Advanced Super Thanx
-jori luoto


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Calculate hours from 10:00-21:00 format

Hi Frank,

a better formula (IMO) is

=MOD(B1-A1,1)

One for your library?

--

HTH

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

"Frank Kabel" wrote in message
...
Hi
why not split these values in two columns. Use 'Data - Text to columns'
for this. Afterwards simply subtract the values with a formula like
=B1-A1

and if your time values can span midnight use
=B1-A1+(B1<A1)


--
Regards
Frank Kabel
Frankfurt, Germany


Jorch wrote:
Hello!

mr Somebody has a several worksheets wich includes lots of cells

which
has start and end hours in format 10:00-18:00, 13:15-21:15 etc...

Cells are formatted as text.

He asked me if it's possible to calculate hours between start and
end hours automaticly. I check out macros and notice that java, php
and few other programming languages does not help me now.

I notice that if end hour is before start hour calculation works but
not vice versa.

How can i split string into two pieces and calculate it to other

cell.

Let's say cell X includes string "10:00-20:00", I split it to Array
whics becomes 2 dimension arr and then calc cell Y value =
Array2-Array1.

Is there function to evaluate text cells???

I think this is possible but how????????

Advanced Super Thanx
-jori luoto




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Calculate hours from 10:00-21:00 format

Bob
neat :-)

--
Regards
Frank Kabel
Frankfurt, Germany


Bob Phillips wrote:
Hi Frank,

a better formula (IMO) is

=MOD(B1-A1,1)

One for your library?


"Frank Kabel" wrote in message
...
Hi
why not split these values in two columns. Use 'Data - Text to
columns' for this. Afterwards simply subtract the values with a
formula like =B1-A1

and if your time values can span midnight use
=B1-A1+(B1<A1)


--
Regards
Frank Kabel
Frankfurt, Germany


Jorch wrote:
Hello!

mr Somebody has a several worksheets wich includes lots of cells
which has start and end hours in format 10:00-18:00, 13:15-21:15
etc...

Cells are formatted as text.

He asked me if it's possible to calculate hours between start and
end hours automaticly. I check out macros and notice that java, php
and few other programming languages does not help me now.

I notice that if end hour is before start hour calculation works

but
not vice versa.

How can i split string into two pieces and calculate it to other
cell.

Let's say cell X includes string "10:00-20:00", I split it to

Array
whics becomes 2 dimension arr and then calc cell Y value =
Array2-Array1.

Is there function to evaluate text cells???

I think this is possible but how????????

Advanced Super Thanx
-jori luoto


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calculate hours from 10:00-21:00 format

Thanx both of you... that seems to be working fine.
That was kind of thing i was searching.

-jori

On Sun, 30 May 2004 16:15:31 +0200, "Frank Kabel"
wrote:

Hi
why not split these values in two columns. Use 'Data - Text to columns'
for this. Afterwards simply subtract the values with a formula like
=B1-A1

and if your time values can span midnight use
=B1-A1+(B1<A1)


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
Calculate total time(hours/minutes) from text/custom format column Steve Allen Excel Discussion (Misc queries) 4 December 13th 08 02:22 AM
How do I format a cell to calculate overnight Hours? Erica Excel Discussion (Misc queries) 7 October 28th 08 01:54 AM
How can I calculate hours into pay...in this format hh:mm:ss Nikki27 Excel Discussion (Misc queries) 2 March 20th 08 02:11 PM
Format Cells to calculate hours and minutes taken to complete task AndyO_UK Excel Worksheet Functions 5 March 8th 07 10:45 AM
Drivers Hours Timesheet - Calculate Hours Worked on Weekly Basis Graham Excel Discussion (Misc queries) 2 January 28th 07 08:40 PM


All times are GMT +1. The time now is 09:39 PM.

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"