Adding time interval to time

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26
Hi

I have a start time and then subsequent time intervals for each sample of reading that I am taking. I want to add the absolute start time to my time interval to have absoute time with each reading.

Also i need to make macro out of it so that each time user opens file he gets all the calculations done.

Any help would be greatly appreciated.

Thanks and Regards
Pooja
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi, pooj_malh
Welcome to the Board !!!!!

you can add up times just by using "+"
symbolic overwiew (this is not a real formula not code)
startTime + elapsedTime = endTime

to my sense there is more info needed to help

each time user opens file
a little experiment to do
Code:
Private Sub Workbook_Open()
MsgBox "hello," & vbLf & "the time is: " & Time
End Sub
TO INSTALL IN THISWORKBOOK CODE WINDOW:
1. Rightclick the little Excel-icon on the topleft of your page just beside the Filemenu
2. Select "View Code" in drop down menu
3. VBE window will open ... paste code in and exit VBE


kind regards,
Erik
 

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26
Excel Add times

Hey Eric ,
Thanks a lot for the reply.

Let me make things little more simpler.
This is time
Time 00:28.4
Paste it in Excel and you ll be able to find out.

And I have time intervals in ms
0.001
0.002


I want to add both of these and get the absolute time.

Thanks and regards
Pooja
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
I suppose you meant
0.001 seconds and not 0.001 ms

see this example
the values in A2 an A3 are supposed to be seconds: when you would add them up like they are displayed, Excel coniders them as part of a day
Therefore you need to divide those values by 24*60*60=86400

  A         
1 00:28,4   
2 0,001     
3 0,002     
4 00:28,403 

Blad1

[Table-It] version 06 by Erik Van Geit
Code:
RANGE FORMULA (1st cell)
A4    =A1+SUM(A2:A3)/86400

[Table-It] version 06 by Erik Van Geit
format the result cell (in this case A4) as mm:ss,000

getting further ?

best regards,
Erik
 

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26

ADVERTISEMENT

The code is giving an error
Complie error
Expected: list separator or )

Thanks for help
 

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26
hey Eric
sorry for the incomplete reply...I think I need to put in some thing in place of "1st Cell"

I am not sure abt it

Let me know if you need more details

Thanks again
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832

ADVERTISEMENT

there is no code

1. did you try to paste something of my post somewhere in a macro ??

2. some display formulas in "code"tags
so do I and so does my Add-In "Table-It"
the reason is that some formulas are interpreted by the Board-language-system as htmlTags: then formulas are displaying wrong

3. conclusion: I gave you a formula to paste in cell A4

4. admitted sometimes others think they should use code, I hope some day the Board will have "formula"tags

best regards,
Erik
 

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26
Eric-

Well I
1) right clicked the excel symbol on the left corner
2)Pasted the piece of formula and closed the window.
3)Then i reloaded my file ..nothing happened.
4)So i opened the VBA and tried debugging the formula.

I really appreciate the help that you are providing. I am really sorry for creating any misunderstandings.


I ll try all the pieces of information that you gave and get back to you

Thanks and regards
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
OOOH!

now I see
you are talking about the workbook_open code, while I'm talking about the table + formula I sent

WAIT A MOMENT
let's be clear ...

your question has 2 parts
1. formula part
your words:
Paste it in Excel and you ll be able to find out.
paste my table in your sheet and the formula in A4
I hope you read my explanation of the formula
2. code when workbook opens
paste only the code
Code:
Private Sub Workbook_Open() 
MsgBox "hello," & vbLf & "the time is: " & Time 
End Sub
when the workbook opens you should get a messagebox

when you can make both parts to work, when can focus on applying all this to your project
(so it's important you forget your project for a while to make the basics work: then we can elaborate)

best regards,
Erik
 

pooj_malh

New Member
Joined
Sep 25, 2006
Messages
26
Thanks Eric,

I try all this and keep tring until it works.

I am really grateful to you.

Thanks for your time and consideration


Regards
Pooja

Trying the formula.........................will be back when problem is beyond my scope of knowledge
 

Forum statistics

Threads
1,136,612
Messages
5,676,796
Members
419,651
Latest member
alexanderguhr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top