Adding Date/Time fields

T

teastman

12/31/05 - 08 Hrs 10 Mins
01/01/06 - 01 Hrs 00 Mins

How do I add these two fields ? I don't need the date, just adding the
times.
 
P

Peo Sjoblom

Assume they are in A1:A2 and the format is always the same with spaces, Hrs,
Mins and -

=SUMPRODUCT(--SUBSTITUTE(SUBSTITUTE(MID(A1:A2,FIND("-",A1:A2)+2,255),"Mins",""),"Hrs",":"))

--
Regards,

Peo Sjoblom

(No private emails please)
 
G

Gary''s Student

In A1 and A2 put:
12/31/2005 8:10
1/1/2006 1:00

in A3 put:
=(A1-INT(A1))+(A2-INT(A2)) and format as time 13:30 and you will see:

9:10
 
T

teastman

Gary's student, your solution works fine. But if I add more and more
records to add... how do I do a totalled range. For example adding all
columns from a1 to a20.
 
P

Peo Sjoblom

1 You really don't need to use INT since it is an extra step, you can use
MOD instead like in

=SUMPRODUCT(MOD(A1:A20,1))

make sure the cell with the formula is formatted as [hh]:mm or else it will
not display times over 24 hours



--
Regards,

Peo Sjoblom

(No private emails please)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top