Word Table formulas for adding time

hello, 

I’m trying to use Word to layout a long agenda for an event. Ideally I’d be able to use formulas to update the start and end time of each event as i shuffle them around. Specifically, I’d love to put thr duration of the event in the first column, and have the start time in the second column and the end time in the third column. Ideally the second and third columns (start and end times) will calculate automatically by taking the end time of the previous row and adding the duration of this row. 

Is this possible? It certainly is in excel. But in word, i can’t get it to read the times as times. In other words, 9:00 AM + 0:30 = 9:30 AM. I cant figure this out in word. Any help is appreciated! 

At http://www.gmayor.com/downloads.htm#Third_party you'll find a link to download DateCalc.zip, a tutorial on date/time field formulas in Word for almost anything you can think of. It's the work of fellow MVP Paul Edstein (a.k.a. macropod).

You can start with the example in "Date and Time Calculations in a Table", about halfway through the document. Applying the same principle to time calculations isn't simple but can be done.

If the end time of the previous row is bookmarked as "prev", the first column could contain the field

{ QUOTE { ask d "Duration in hours:minutes" { d } } }

and the second column, the start time (assumed to be the same as the previous row's end time), would be

{ QUOTE { prev } }

Then the third column, the end time of the current row, could be calculated as

{ QUOTE { SET ph{ = { prev \@ H } } } { SET pm{ = { prev \@m } } } { SET dh{ = { d \@ H } } } { SET dm{ = { d \@ m } } } { SET eh{ = ph + dh + INT((pm + dm)/60) } } { SET em{ = pm + dm } } { IF em > 60 { set em{ = em - 60 } } } "{ eh }:{ em }" }

The hard part is that Word allows only one bookmark with a given name per document. You'd need some macro support to convert the result to plain text (unlink the fields) and then recreate the prev bookmark and put the fields into the next empty row.

_____________________________
https://jay-freedman.info

3 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You may find the field formulas in https://stackoverflow.com/questions/21335920/ms-word-2010-time-increment-in-table useful for this.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

It would probably be a lot easier to use Excel or an Excel Spreadsheet in a Word document.

Image

Formula in B3 is =C2

Copy the formula in C2 and B3 down as many rows as necessary and then just enter the Duration of each activity and everything falls into place.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com

4 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 14, 2025 Views 6,723 Applies to: