# Adding time interval to time

#### pooj_malh

##### New Member
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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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

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

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

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

[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

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

Thanks for help

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

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

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

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 ...

1. formula part
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

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

Replies
2
Views
325
Replies
4
Views
264
Replies
14
Views
582
Replies
6
Views
102
Replies
0
Views
375

1,216,129
Messages
6,129,046
Members
449,482
Latest member
al mugheen

### 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.

### Which adblocker are you using?

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

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