Ever wanted to make a cool, snazzy interactive chart in Excel? Something like this:
In this tutorial, learn all about making your very first interactive chart.
Click here to download the workbook with chart template and all the formulas. Refer to it while reading the article.
Interactive chart in Excel – Tutorial
There are several ways to make an interactive chart in Excel. You can use data validation, form controls, slicers, timelines, VBA or hyperlinks. In this tutorial, learn how to make an interactive chart with data validation and slicers. For other techniques, refer to resources section of this post.
Interactive chart with Data Validation
Let’s say you are the product manager at Billette consumer care. You are looking at historical order quantity data for various products. Your data looks like below:
Making one chart with all of this is going to be very busy and hard to read. You want to make a dynamic or interactive chart so your boss can choose which product she wants to analyze and understand the order trend.
Step 1: Make a list of all choices
Select all the product names and go to Namebox (top left corner) and type a name like products.
- Alternatively, you can also list the product names in a separate range and give that a name.
Let’s say we have the products in the products name.
Step 2: Set up selection mechanism
- Decide which cell will have the user selection. Let’s say this is Q5. Select the cell and go to Data > Data Validation.
- Change validation criteria to Allow > List.
- Type products in the Source. Click ok.
Now, we have way to select product in the cell Q5.
Related: Excel basics – How to setup in-cell drop downs in Excel.
Step 3: Find out which product is selected
If we want the name of the product selected, we can simply use =Q5. For the rest of calculations, we need the number of the product (ie what is the position of the selected product in products). For this, we can use MATCH formula, like below.
Type this MATCH formula in an empty cell like I3.
=MATCH(Q5, products, 0)
This will return a number, matching the product user has picked.
Step 4: Calculating order quantity to show in the chart
Now, assume we have the number of product selected in cell I3. Given this, we can calculate picked product’s quantity using a simple INDEX formula:
=INDEX(data1[@[Soap]:[Deodorant]],$I$3)
If your data is in a normal range, rather than a table, use a formula like this:
=INDEX(C6:H6,$I$3)
Fill down the formula.
Now that we have calculated product quantity values for selected product, if you change I3, you will see values for the relevant product.
Step 5: Create the chart
Now that all the background work is done, let’s insert a chart.
Simply select picked product column and insert a column or line chart. We get this:
First, let’s add axis labels. Right click on the chart and go to select data. Edit horizontal / category labels and select the month column.
Now, remove chart title and chart border (set it to no line). We end up with something like this:
Step 6: Bring everything together
Are you ready for the chart? We are almost done. We just need to bring everything together and our first interactive chart will be kicking and beating.
- Position the chart under cell Q5 (the data validation selection cell)
- Go to Insert > Shapes > Rounded Rectangle and draw a nice big rectangle around the chart and Q5.
- Remove fill color from the shape and adjust the line.
- Now, when you pick a new product from Q5, your chart will update.
Interactive chart with Pivot Table and Slicer
If you are too shy to INDEX + MATCH on weekdays, you can try the Pivot Table approach. This works very well and let’s you make equally amazing interactive charts. See below quick demo.
Keep in mind that your data needs to get fit. Rearrange so it looks like this. If you need help, read: Unpivot data quickly with Power Query.
Step 1: Insert a pivot from your data
Select your data (month, product and quantity columns) and insert a pivot table.
- Add Month to row labels area. In newer versions of Excel, this will create date hierarchy – Year, Quarter and Month. If so, drop Quarter.
- Add Quantity to values area.
- Right click on Product and add it as a slicer.
Related: Introduction to Excel Pivot Tables
Step 2: Insert a pivot chart
Select any cell inside the pivot and go to Analyze ribbon > Pivot chart. Select either a line or column chart.
We get this:
In newer versions of Excel, you can insert a pivot chart directly from data. But I find the pivot table first approach better as you can adjust items you want before charting.
Step 3: Format the pivot chart
- Select the pivot chart and go to Analyze ribbon and turn off Field Buttons.
- Replace chart title with “Total Order Quantity in last 13 months” or something like that.
- Set chart border to No line.
- Position the slicer adjacent to the chart.
- Draw a rounded rectangle around the thing
- Our interactive chart is ready for play.
Optional makeup hints:
If you want more bang for your chart,
- Add a sub-title describing the trend. Refer to download example file for inspiration. Read: Give descriptive titles to your charts
- Set limits on the vertical axis. By default Excel will change Y axis limits whenever your pick a product. This can create some distortion of the numbers and confuse your users if they want to compare products. You can format the axis and set limits. Select the axis, press CTRL+1 and set minimum to 0 and maximum to highest possible value (rounded of course). For our example, this could be 2000. This way, only bar heights change, not the axis.
- Adjust gap width. Excel would pick some ridiculous value like 219%. Adjust this to 100% or something like that for less white space on the chart. To do this, click on the columns, press CTRL+1 and from Series options adjust the gap width.
Create your first interactive chart in Excel – Video tutorial
Check out below video tutorial to understand all these steps in detail. Make sure you practice by downloading the example workbook. Watch it below or on our YouTube channel.
Download Excel Interactive Chart workbook
Please click here to download interactive chart workbook. Play with charts and examine formulas to learn more.
Want more interactive charts?
Check out below examples to see what else is possible.
- Target vs. Actual – Biker on a hill chart
- Then vs. Now chart in Excel
- How tax burden has changed over time – Interactive chart in Excel
What is your favorite way to make interactive / dynamic charts in Excel?
I used to make charts with formulas all the time. But now a days, I prefer making them with pivot table + slicer route if possible. This reduces the amount of formula work needed and still gives awesome results.
What about you? What is your favorite technique for creating interactive charts? Please share in the comments section.
27 Responses to “How to Embed Youtube videos in to Excel Workbooks?”
Thank you!!
The trick is to get that URL for video. Some videos have this feature disabled... hmm...
very cool. how did you record what you do on Excel? it didn't seem like you was using a camcorders.
This is a great tip. Is it possible to insert a PDF on an excel worksheet? I usually receive quotations in pdf format, and would like to show the quote on a worksheet, rather than using hyperlinks. Any and all help would be greatly appreciated.
Your instructions didn't work for me, ether in Excel 2010 or 2007, and I tried several times, following the instructions very carefully and to the letter.
What I found out is that, for some odd reason, copying the YouTube URL then adding the ?fs=1&hl=en_US to the end would not work at all for me.
But if I went to the Embed code in YouTube and copied value parameter (minus quotes) and pasted it into the movie property, the movie would play. The Embed code value parameter includes the link and the extra bit you included at the end. No need to copy that as an extra step.
Best feedback on here. Worked like a charm after removing extra YT code. Thanks..
@Gregory,
Thanks your instructions.
I have carefully followed the Instructions mentioned by you and still i am unable to do embed the video in excel.
Please help and your immedate reply will be higly appreceiable.
Regards
Sonu Monga
A Chartered Accountant
If you are using excel 2010 or higher. then there is nothing like Shockwave flash player.
In that case you have to use windows media player.
There is a control naming Windows Media Player in that list.
Insert that contol and then open properties and insert link in URL.
It will work.
@Gregory,
Thanks your instructions.
I have carefully followed the Instructions mentioned by you and still i am unable to do embed the video in excel.
Please help and your immedate reply will be higly appreceiable.
Regards
Sonu Monga
Chartered Accountant
It wouldn't play because you need to indicate the exact location of flash file....by 'Embedding' the file, you get the the exact URL, so it can be played....some videos can't be 'embedded' that's why it won't work....
My developer tools does not list a control for "Shockwave flash object". Where/How do I find it?
Hi Chandoo,
why don't use OCX Window media player ???
you can play your own local video or music
just indicate exact location (Full path or URL)
i.e :
C:\Users\Public\Music\Sample Music\Kalimba.mp3
C:\Users\Public\Videos\Sample Videos\Wildlife.wmv
with macro and userform :
Sub PlayMedia()
On Error Resume Next
UserForm1.WindowsMediaPlayer1.URL = ThisWorkbook.Path & "/" & ActiveCell.Value
' ----- or
' ----- UserForm1.WindowsMediaPlayer1.URL = Exact location
End Sub
Very cool. I also could not get the instructions to work, but was able to use Gregory's suggestion about the embed code. Thanks for posting!
Thanks Chandoo. This is very cool. I was able to make it work using the embed code copying from http: up to _US as you indicated. This is a great way to provide additional training or message as you package your deliverable.
[...] Trying to become a bit flashier with your dashboards? Maybe you’re just looking to include additional material. Take a look at this quick tool to embed YouTube videos in excel workbooks. [...]
Hi Chandoo,
Excellent tip. Very useful.
Is there anyway to link the path in the properties to a cell value so that the user can select the video from a drop down and then have the video play?
Thanks Myles.... to link the path to a cell, I guess you need to use macros..
nothing happend in Embed Youtube videos in to Excel Workbooks, it shows only white blank screen.
Hi Chandoo, How Do I put more than one URL in movie field?
Hi Chandoo,
very good tip.
But how do I start the embeded video in an xlsm file once the tab is selected or through VBA programming?
Appreciating your answer
Steve
Query:
I have created 4 sheets excel file, but when i print this file to PDF it generates two sheets one PDF and two Sheets one PDF … can i know the setting which i had to change. because i want all 4 sheets in one PDF
while Printing i did setting as "Print Entire Workbook"
Awaiting for your reply.
Help!! THis works great, but I'm trying to use VBA to change the URL, which I can do. The problem I am having is getting it to play via VBA.
The object has both .play and .playing = true properties, but neither will actually play the video after updating the .movie url. The correct video appears within the object, but I can't get it to play from VBA... which I really need it to do.. Thoughts?
Hello
Go to Developerr tab and select more control then find windows media player just click it.
after that you have to right click on the embeded object and select properties there you need to add your video file path.(dont forget to include extension like .avi, .mov etc.) in URL field. Then Press Alt+11 and deselct design mode. Once you close the module your video start playing.....
For the life of me, I cannot get this to work. I have followed Chandoos instructions to the letter and also tried using the embed code as Gregory suggested, all I get is a blank white box where the video should be. Is there any other reason that this might not work? Flash version perhaps? Quite frustrating.
Hi I was wondering if was a way after adding a video if one could save to HTML format and it would work?
Hi Chandoo,
This is very helpful, however, is there a way to auto-play the embedded youtube video as soon as somebody opens the excel file? Can you share the macro for the same?
Hi,
Very cool, how is it possible to start automatically the video when the excel sheet is open?
I would like to start the video when i open the worksheet :).
Best regards.
Hello
When trying this method, I got Flash-embedded videos are no longer supported. Is there a solution for this problem?