In-cell charts are awesome.
And today, I’ll show you how to create an in-cell bar chart with REPT function.
But, do they really worth your time?
But, do they really worth your time?
Yes.
Here is the single important reason:
They are easy to create and simple to use.
Ahead, in this post, I’ll show a step by step process to create a decent bar chart with REPT function.
But Do You Know About REPT Function?
Here is a simple definition: You can use REPT to repeat a specific text for a specific number of times.
The main use of this function is for creating in-cell charts.
Syntax
=REPT(text, number_times)
Steps to Create a Bar Chart With REPT Function
Here you have a mark sheet of students and you need to add a bar in the performance cell next to the marks column.
Here are the steps.
- Insert two option buttons in your worksheet.
- Go to developer tab ➤ controls ➤ insert ➤ option buttons.
- Name both of the buttons “Only Percentage” & “Bars”. And, link then to a cell. (I have linked then to cell A1)
- Now, come back to your data table and insert the following formula into the cell.
- Make sure to change font style to “PlayBill”.
- Now, drag the formula to the entire table and your bar chart is ready.
We have used a formula in conditional formatting to highlight bar for the student whose marks are below 40.
How this formula works
In this formula, you have used IF function for a conditional formula.
When you select options button “Bars” you’ll get 1 in cell A1 and then REPT function shows you a bar and percentage in the cell.
And, when you select “Only Percentage” it will show just percentage.
Sample File
Download this sample file from here to learn more.
Conclusion
By using this technique you can fire up your boring data.
If you compare both of the tables (with or without bars), you’ll notice that by using bars you can present your data in an understandable way.
Now tell me one thing.
Do you like this tip?
Share your view with me in the comment section, I’d love to hear from you. And, please don’t forget to share this tip with friends.
Must Read Excel Tutorials
About the Author
Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.
the bar has gone too large when i use 1000 instead of 100 in percentage ,is it can be fixed?
This is great Puneet! Keep publishing more.
Thanks
Thanks, Puneet; nice tip!
Hey When I am trying to assign cell A1 to the option button a message is displayed showing invalid reference. What to do!
Hi – in the formula you have (“|”)- Where is this on keyboard?
Thanks
Above the enter key.
This is wonderful Puneet. Thanks a lot.
One input – you have mentioned “Make sure to change font style to PlayBill”. This is fine with bars but it shrinks the percentages mentioned along with bars, making it difficult to read. Font “Britannic Bold” used in the Excel file is a better option removing this drawback. 🙂
Yes, you are absolutely right.
Thank you so much!
You’re welcome. 🙂
I gone through the structure of the formula. I was unaware with rept function and also innovative & efficient use of radio button. This is extreamly helpful to interpret the huge data quickly and without burning much of your laptop RAM.
Thanks Puneet Gupta for this excellent trick.
I’m so glad you liked it. 🙂