COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Time Calculations

• Email
• Follow

```Does anyone know of a method to compute times as in track & Field? For
example, Runner#1 finishes 800m in 2:02.37, Runner #2 finishes in
1:58.6. The metod I've used so far is cumbersome. Multiply 1st number by
60(for minutes), add result to 2nd number(seconds) and and 3rd
number(hundreths of a second) to get one total. Results can then be
sorted by the Total column. Is there a better way?

sfwilson
```
 0
Reply coach777 (1) 2/20/2005 4:29:42 PM

See related articles to this posting

```In article <111henpri0dur06@corp.supernews.com>,
sfwilson <coach777@megahits.com> wrote:

> Does anyone know of a method to compute times as in track & Field? For
> example, Runner#1 finishes 800m in 2:02.37, Runner #2 finishes in
> 1:58.6. The metod I've used so far is cumbersome. Multiply 1st number by
> 60(for minutes), add result to 2nd number(seconds) and and 3rd
> number(hundreths of a second) to get one total. Results can then be
> sorted by the Total column. Is there a better way?
>
> sfwilson

I can think of a couple of different ways.

1. Make two number fields, one for minutes and the other for seconds
(including decimal fractions). Enter the minutes in the minutes field
and the seconds and fraction in the seconds filed.

Create a calc field that you could name CalcSeconds, with the formula
60*minutes + seconds. Use that calc field for any further calculations.

2. Create a text field for recording the time in your customary format,
mm:ss.s. Create a calc field to parse this out and calculate the result
in seconds, thus:

Left(Time;Position(Time;":";1;1)-1)*60+Right(Time;Length(Time)-Position(T
ime;":";1;1)-1)

In order for this second method to work, all the times have to be in
consistent format, that is, the colon has to separate minutes and
seconds.

Use whichever of these seems easiest for you.

Bill

--
To send e-mail, remove .invalid
```
 0

```On Sun, 20 Feb 2005 11:29:42 -0500, sfwilson wrote:
>  Does anyone know of a method to compute times as in track & Field? For
>  example, Runner#1 finishes 800m in 2:02.37, Runner #2 finishes in
>  1:58.6. The metod I've used so far is cumbersome. Multiply 1st number by
>  60(for minutes), add result to 2nd number(seconds) and and 3rd
>  number(hundreths of a second) to get one total. Results can then be
>  sorted by the Total column. Is there a better way?

no - if you enter all data to a single field, it must be of type text.
You need some calculation in order to split it to minutes, seconds and
hundreds.

But whats the problem?

case(
wordcount(
substitute(text;[":", " "];[".", " "])=3;
leftwords(
substitute(text;[":", " "];[".", " "]);1) * 6000 +
middlewords(
substitute(text;[":", " "];[".", " "]);2;1) * 100 +
middlewords(
substitute(text;[":", " "];[".", " "]);3;1);

"?"
)

That's a sample function for conversion which will simply verify whether
there are three time parts. You may improve this for other time formats,
including e.g. hours or no minutes or no hundreth or...

Martin
```
 0