Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Time Diff from text format

I have searched for quite some time but can't seem to find the same problem.
I have a file containing 50,000 lines containing scheduled times and actual
times but the catch is that the original source formats the time as 630 for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from each
other, but that didn't work. I tried a variey of formulas listed here but
none worked. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Time Diff from text format

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same problem.
I have a file containing 50,000 lines containing scheduled times and actual
times but the catch is that the original source formats the time as 630 for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from each
other, but that didn't work. I tried a variey of formulas listed here but
none worked. Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Time Diff from text format

This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same problem.
I have a file containing 50,000 lines containing scheduled times and actual
times but the catch is that the original source formats the time as 630 for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from each
other, but that didn't work. I tried a variey of formulas listed here but
none worked. Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time Diff from text format

Yes, you did something wrong. you've got the cell formatted as a number (a
fraction of a day), rather than as time. A suitable format would be
[h]:mm:ss.
You may then find you've got problems because Excel doesn't usually like
working with negative times, so you'll probably have to use Tools/ Options/
Calculation:
1904 date system (but you'll need to be careful if you transfer data to &
from between 1904 and 1900 systems).
--
David Biddulph

"JICDB" wrote in message
...
This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same
problem.
I have a file containing 50,000 lines containing scheduled times and
actual
times but the catch is that the original source formats the time as 630
for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from
the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from
each
other, but that didn't work. I tried a variey of formulas listed here
but
none worked. Any ideas?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Time Diff from text format

You are a genius and I bow to you!! It worked like a charm. Thanks!!!



"David Biddulph" wrote:

Yes, you did something wrong. you've got the cell formatted as a number (a
fraction of a day), rather than as time. A suitable format would be
[h]:mm:ss.
You may then find you've got problems because Excel doesn't usually like
working with negative times, so you'll probably have to use Tools/ Options/
Calculation:
1904 date system (but you'll need to be careful if you transfer data to &
from between 1904 and 1900 systems).
--
David Biddulph

"JICDB" wrote in message
...
This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same
problem.
I have a file containing 50,000 lines containing scheduled times and
actual
times but the catch is that the original source formats the time as 630
for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from
the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from
each
other, but that didn't work. I tried a variey of formulas listed here
but
none worked. Any ideas?






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Time Diff from text format

Ok these people are never happy - now they tell me that what they want is the
minutes in hundreds. So instead of a different of -1.30 for one hour and
thirty minutes they want -1.5 hours. Can this formula be adjusted to
accomodate this request?

"David Biddulph" wrote:

Yes, you did something wrong. you've got the cell formatted as a number (a
fraction of a day), rather than as time. A suitable format would be
[h]:mm:ss.
You may then find you've got problems because Excel doesn't usually like
working with negative times, so you'll probably have to use Tools/ Options/
Calculation:
1904 date system (but you'll need to be careful if you transfer data to &
from between 1904 and 1900 systems).
--
David Biddulph

"JICDB" wrote in message
...
This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same
problem.
I have a file containing 50,000 lines containing scheduled times and
actual
times but the catch is that the original source formats the time as 630
for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from
the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from
each
other, but that didn't work. I tried a variey of formulas listed here
but
none worked. Any ideas?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Time Diff from text format

If you were getting -0.009027777 for your -13 minutes, leave it as format
general or number, rather than time, and multiply it by 24 and that will
give you an answer in hours. If you want it in minutes, multiply the hours
by 60.
--
David Biddulph

"JICDB" wrote in message
...
Ok these people are never happy - now they tell me that what they want is
the
minutes in hundreds. So instead of a different of -1.30 for one hour and
thirty minutes they want -1.5 hours. Can this formula be adjusted to
accomodate this request?


"David Biddulph" wrote:

Yes, you did something wrong. you've got the cell formatted as a number
(a
fraction of a day), rather than as time. A suitable format would be
[h]:mm:ss.
You may then find you've got problems because Excel doesn't usually like
working with negative times, so you'll probably have to use Tools/
Options/
Calculation:
1904 date system (but you'll need to be careful if you transfer data to &
from between 1904 and 1900 systems).
--
David Biddulph

"JICDB" wrote in message
...
This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this
formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same
problem.
I have a file containing 50,000 lines containing scheduled times and
actual
times but the catch is that the original source formats the time as
630
for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time
from
the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from
each
other, but that didn't work. I tried a variey of formulas listed
here
but
none worked. Any ideas?






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Time Diff from text format

Format the cell as Custom h:mm

BTW: B1 contains 632 and A1 contains 619

Negative times will give you an error of ############# so don't bother trying to
subtract 632 from 619


Gord Dibben MS Excel MVP

On Mon, 5 Mar 2007 09:36:18 -0800, JICDB
wrote:

This didn't work for some reason. Here's my example:
The bus was supposed to stop at 619 (actual number in spreadsheet) but
actually picked up at 632. The difference should be -13 but this formula
give me -0.009027777. Did I do something wrong?

"JE McGimpsey" wrote:

One way:

=TEXT(B1,"00\:00")-TEXT(A1,"00\:00")

or, if the times may span midnight,

=MOD(TEXT(B1,"00\:00")-TEXT(A1,"00\:00"),1)

In article ,
JICDB wrote:

I have searched for quite some time but can't seem to find the same problem.
I have a file containing 50,000 lines containing scheduled times and actual
times but the catch is that the original source formats the time as 630 for
6:30 or 1350 for 1:50pm. I am trying to subtract the actual time from the
scheduled time to determine how many minutes the bus was late.

I tried adding leading zeros and subtracting the left 2 digits from each
other, but that didn't work. I tried a variey of formulas listed here but
none worked. Any ideas?



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
aps3 calculate diff in time and cinvert into another format abe Excel Worksheet Functions 1 April 26th 06 08:55 PM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM
Diff. in time justmeisall Excel Worksheet Functions 1 November 11th 04 05:56 PM
Diff. in time justmeisall Excel Worksheet Functions 0 November 11th 04 03:52 PM
Diff. in time justmeisall Excel Worksheet Functions 1 November 11th 04 03:24 PM


All times are GMT +1. The time now is 06:28 AM.

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

About Us

"It's about Microsoft Excel"