Calculating Timecode in Excel

Posted: 11 August 2011 by Chris Hocking

Today I was contacted by a filmmaker friend that wanted to work out a way to calculate timecode within an Excel spreadsheet. Fortunately there are some great Macro’s out there that allow you to do just that, however the one I recommended is not terribly well documented, so I thought I would jot down some notes here.

The tool I recommended was Excel Time Code Extension by Matthias Bürcher. It hasn’t been updated since 1997, however it still works great, even on the later versions of Excel. Although there is some great documentation floating around on the Internet (this blog is probably the best resource – especially the comments), when I first downloaded it all I really wanted was a Installation Guide and an Example.

Here’s a crash course for Mac users out there – although the workflow is very similar for PC users. I tested this on MacOS 10.6.8 and Excel 2008.

1. Download the XLA script from here (I hope you don’t mind Matthias, but I’ve also mirrored it here - just in case your site ever goes down).

2. Unzip the download, and then drag the XLA file into Excel.

3. You will be presented with a Macro Warning – just click Open.

4. You will now be left with a blank Excel workbook. To activate the plugin, press Command+Option+T (Windows users can just press Control + T I’m told, although I haven’t tested it personally yet). In the bottom status bar you should see a message like the below to confirm that everything is working properly:

5. You can now start getting to work! Select the fields you want to use as timecode fields, then click Format > Style from the top menu bar.

6. Then select Time Code from the Style Name and click OK.

7. You can now enter timecode into the fields you selected previously. Enter it as a full number, without any spaces (for example 01013000). Excel will automatically format it nicely (i.e. 01:01:30:00).

8. With that complete, you can now start doing some calculations. For the purposes of this demonstration, let’s just add A1 and A2 together. There’s probably a much quicker way to do this, but the most reliable method I’ve found is to convert the timecode values to frames, do the calculations as frames, then convert the frames back to timecode at the end. So, in B1 let’s display the value of A1 as frames (at 25fps). To do this type:

=TCtoframes(A1,25)

9. And do the same for B2:

=TCtoframes(A2,25)

10. Now add B1 and B2 together:

=B1+B2

11. Now let’s use the cell A4 to show our final calculation. The first thing you need to do is change it to a timecode style (as per step five and six above), then you can enter the following calculation:

=framestoTC(B3,25)

12. And assuming everything was typed in correctly – you should now have your finished calculation!

There is a list of all the different functions you can use here, although there’s a more detailed explanation on the French page (which you can use Google Translator or similar to translate).

However, most functions don’t really need much explanation, so here’s a summary of what’s available:

  • TCtoframes(TC,fps)
  • framestoTC(frames,fps)
  • TCplus(TC1,TC2,fps)
  • TCminus(TC1,TC2,fps)
  • TCmult(TC1,facteur,fps)
  • TCdiv(TC1,facteur,fps)
  • TCsum(TCref,fps)
  • TCtrans(TC,fromfps,tofps)
  • TCtofeet(TC,gauge,fps)
  • feettoTC(feet,gauge,fps)
  • TCtometer(TC,gauge,fps)
  • metertoTC(meter,gauge,fps)
  • timetoTC(intime)
  • TCtotime(inTC)
  • texttoTC(intext)
  • TCtotext(inTC,fps)
  • isTC(TC,fps)
Finally, here is an nice and simple example Excel sheet you can download and test for yourself. It’s basically exactly the same as the above example, except laid out a bit nicer. Hope it helps!


10 Responses to "Calculating Timecode in Excel"

I keep getting stuck on TCminus(TC1,TC2,24). It gives me the error

Macro Error
Names cannot look like references
Macro error at cell [TC.XLA]TC source corr1!E2

Im just trying get a duration of a shot subtracting one time code from another. I’ve tried using colons, semi colons, without the FPS and with. All to no avail. Any ideas would be great!

Chris Hocking says: 28 September 2011 at 3:20 pm

I would suggest just converting everything to frames first, doing the calculations, then convert back to FPS at the very end (as per the example I gave).

In your case, just follow the instructions on the blog, but at step 10, change the plus to a minus.

Hope that helps!

Best Regards, Chris!

I’m losing my mind. I’m doing EVERYTHING you have written here – the exact order you have it written, I’m using EXCEL 2008 on OS 10.6 and it WILL NOT work…. It recognizes the functions(they list when I type in an equals sign), I’m pressing Comm Opt T, I see the website at the bottom … NOTHING?!
Am I retarded? I took computer programming in Engineering. I can’t be THAT stupid! What am I missing?

Chris Hocking says: 8 December 2011 at 9:40 pm

We are also using Microsoft Excel 2008 on a Mac running 10.6.8 – so that shouldn’t be an issue.

If you followed the instructions exactly – then it should just work.

Try exiting Excel, then starting again. Make sure at Step 5 that you select ALL the cells you want to be used for timecode values.

Also, try downloading my example. It probably won’t actually work (as for some strange reason Excel won’t import the XLA script properly on sheets you don’t create yourself) – but you can use it to check that the syntax is the same.

Good luck!

Hi thanks for the post it helps explain it a lot better than the website.

A question though… does anyone have a macro or port of this for Mac Pages ? I really do not want to go back to working in excel! Thanks for any updates and answers to my question.

Chris Hocking says: 6 January 2012 at 8:22 pm

Unfortunately I don’t know of any similar solution for Pages. If you find one – please let me know!

Best Regards, Chris!

Hi Chris, thanks so much for that, couldn’t get it going from the other sites’ instructions. However, I was wondering if you could double check a weird result I get. When I do a ‘TCminus’ (using 25 fps) on 07:21:01 minus 06:55:01 I get 2600 frames, which is obviously not right. 26 seconds yes, which equals 650 frames. Do you get this result too?? It worked fine for me with smaller intervals though.

stefany says: 4 May 2013 at 3:02 pm

Hi Chris, I’m unable to get this to open with my version of Excel (Excel for Mac 2011, v14.0.0). When I drop the “TC.XLA”, a window pops up, and it says:

“Microsoft Excel 5.0/7.0 opening TC.XLA”
(with a progress bar under it)

However, nothing happens, b/c immediately, this window pops up:

“This file contains Visual Basic Macros. The macros that have been disabled. If you save it, the file will contain the Visual Basic project”

There’s an option to click OK, which I did, and then I get another window:
“This workbook contains defined names that conflict with valid cell references. To correct this issu, underscores (_) have been added to the defined names that conflict with the cell references. Conflicting names in XLM macro code have not been changed, and muc be corrected manually.”

Again, there’s an option to click OK, and when I do, the “Microsoft Excel 5.0/7.0 opening TC.XLA” window disappears, and then nothing happens.

So … basically, I can’t get it into my Excel. Any tips you can offer would be greatly appreciated. I have a list of thousands of shots (TC/in and TC/out), and I JUST found out that I need to indicate the duration of each shot. There HAS to be a way, but I can’t figure it out!! :(

Chris Hocking says: 4 May 2013 at 5:26 pm

Hi Stefany,

Sorry – I’ve only tested this on MacOS 10.6.8 and Excel 2008.

Excel 2011 includes specific settings that help you control how users are notified about potentially unsafe macros. On the Excel menu, click Preferences. Under Sharing and Privacy, click Security, and then deselect the Warn before opening a file that contains macros check box, and see if that helps.

This should hopefully allow you to at least open the document. You then need to press Command+Option+T as per the instructions above for the scripts to activate.

However, if that doesn’t work – if you only want to calculate the duration between a start timecode and end timecode, and you have a consistent frame-rate, then you could quite easily put together a formula to do that.

This might be of some help:

http://www.renegrasser.com/393/time-codes-in-excel/

Good luck!

Best Regards, Chris!

stefany says: 5 May 2013 at 6:53 am

Chris -
Thank you so much for the quick response! I appreciate the help & will give this a try!
-Stefany

Leave a Reply