• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Bar graphs

madisa

New Member
Hi, I have a bar graph with frequencies and percentages, how do I make the graph label to show something like "3(5%)" as a label per graph depending on the frequency number. for example 3 = actual frequency 5% = percentage of the frequency to the total.
 
Here is the way I would do it. Let's say, to expand your example, you had the values 3, 25, 32 in A2:C2. In A1, place this formula:


=A2&"("&TEXT(ROUND(A2/SUM($A$2:$C$2),2),"0%")&")"


The meat is the TEXT(ROUND(A2/SUM($A$2:$C$2),2),"0%"). This will divide A2 by the sum of the three columns and round the answer to two decimal positions. The TEXT function has a format string of "0%" which will yield the 5%. The rest of the formula is simply concatenating the original value to be graphed and the parentheses.


Copy the formula in A1 to B1 and C1. You should now have your labels of 3(5%), 25(42%) and 32(53%). Select A1:C2 and insert a bar chart.
 
Thanx for your assistance, i have tested it, it is exactly how I want it, however the final product when I produce a bar graph it puts a label called series with numbers. What I want is the label on the graph to be: Frequency(%) then the following under each graph 3(5%) 25(42%) 32(53%). So the formula you gave me is correct and works well. Your assistance will b appreciated.
 
If could just change the series 1 to reflect on the chart layout to reflect 3(5%) 25(42%) 32(53%). Then I should be sorted.
 
I'm sorry, I did not follow your last post. As far as changing "Series 1", right-click on the chart and select "Select Data..". On the left of the "Select Data Source" window, you will see "Series 1" and an Edit button above it. Click the Edit button and enter this in the "Series name" box: ="Frequency(%)" (with the double quotes). When I did this, it also inserted that value in the chart title. If that is not desired, click on the title to select it and remove the value. If you prefer it in the title and not the legend, click on the legend and hit delete.
 
Back
Top