Dynamic YouTube Timecode URLs in Excel

Nate Lawrence

New Member
Joined
Sep 24, 2019
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello, all.

I enjoy indexing chapters for long YouTube videos, so that others can jump to the topics which interest them.
For example, someone has created a series of videos with a brief overview of every Family Computer/N.E.S. game released in order of their original publish date.

The 2 following links demonstrate:
a) a hyperlink to Episode 5 of "Chrontendo"
b) a hyperlink to the beginning of the Super Mario Bros. coverage within Episode 5

https://youtube.com/watch?v=7YXoL7YZ9Ak
https://youtube.com/watch?v=7YXoL7YZ9Ak&t=6m52s

As you can see, timecodes for YouTube are added by adding "&t=XhYmZs" to the end of the link to a video
(where X is the number of hours, Y is the number of minutes, and Z is the number of seconds that you wish to seek to).

---

In Excel I can use the HYPERLINK function to create dynamic hyperlinks but I'm having a difficult time getting the timecodes formatted in the above manner within the cell which uses =HYPERLINK function.

---

I have:
1) a column A where I input chapter titles,
2) a column B where I input timecodes in a 0:06:52 style,
3) a cell B1 where I store the video ID for a given video (In the above case it would be 7YXoL7YZ9Ak .)
4) a column where I would like to dynamically concatenate the date into a clickable URL.

---

I know that if I format column B as:
Code:
[h]"h"mm"m"ss"s"
then it looks how it needs to be appended to the end of a YouTube URL, ( 0h06m52s ) however cell formatting doesn't affect how the formula accesses the value.

---

I'm able to concatenate most fields in the following manner:
Code:
=HYPERLINK(CONCATENATE("https://youtube.com/watch?v=",$B$1,"&t=",B6),A6)
where B1 contains "7YXoL7YZ9Ak", B6 contains "0:06:52", A6 contains "Super Mario Bros.".

Where I'm failing is that the formula reads "0:06:52" as "0.00476851851851852" which results in:
https://youtube.com/watch?v=7YXoL7YZ9Ak&t=0.00476851851851852 (non-functional)
I need to know how to control the formatting of cell B6 within the formula.

---

Your assistance is greatly appreciated.
.nl
 

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

=HYPERLINK("https://youtube.com/watch?v="&$B$1&"&t="&TEXT(B6,"[h]\hmm\mss\s"),A6)
 
Upvote 0
Solution
That works, Boss!

Many thanks.
I'd tried using the TEXT function but couldn't get the syntax correct.

Your formula works like a charm.
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

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
Back
Top