Graphs of percentage by month

Kijindoragon

New Member
Joined
Feb 24, 2015
Messages
6
Hi, I'm creating a bar graph comparing month by month data (by percent) for 2015. Of course I only have data for January and February so far but I'm making this for other people and can't change it later. I've added the rest of the fields so they'll populate once data becomes available. However, the graph is now very wide with very narrow bars because there are essentially spacers where there will be data later. Is there a way that I can "hide" rows with no data automatically so they'll only take up space once there's something to show?

Thanks in advance!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi, yes there is a way. May I ask how is your raw data arranged?
Example:

Excel 2013
AB
1monthdata
2jan0.338228
3feb0.361635
4mar
5apr
6april
7may
Kijindoragon
 
Upvote 0
Sure. The graph is set up with percentage on the y-axis and month and value on the x-axis.

each condition is an x-axis value which will ultimately have data for every month.

The data is set up for each month as follows:
Column A Column B
Condition 1 - percent of total
condition 2 - percent of total
condition 3 - percent of total
etc.

I can't just wait until there's data in the month to add it, as I need to give this to multiple people and I won't be able to edit it later.

Sorry I'm not sure how to upload a pic to make it easier

Thanks
 
Last edited:
Upvote 0
mmmh so how many columns do you have?
you may post small sample of your data (not chart)
look at my signature for clues.
 
Upvote 0
[TABLE="width: 276"]
<tbody>[TR]
[TD][/TD]
[TD="colspan: 2"]Variances[/TD]
[/TR]
[TR]
[TD]Late Organ Referral[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]50%[/TD]
[/TR]
[TR]
[TD]Late Tissue Referral[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0%[/TD]
[/TR]
[TR]
[TD]Missed Organ Referral[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4%[/TD]
[/TR]
[TR]
[TD]Missed Tissue Referral[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]21%[/TD]
[/TR]
[TR]
[TD]Pre-Approach[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]25%[/TD]
[/TR]
[TR]
[TD]Total Variances 2015[/TD]
[TD="align: right"]28[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

So there's a list like that for each month and the graph will reflect that. Does that help?
 
Last edited:
Upvote 0
maybe along this:

Excel 2013
ABCD
1monthCatValues%
21/1/2015Late Organ Referral1450%
31/1/2015Late Tissue Referral00%
41/1/2015Missed Organ Referral14%
51/1/2015Missed Tissue Referral621%
61/1/2015Pre-Approach725%
72/1/2015Late Organ Referral1872%
82/1/2015Late Tissue Referral14%
92/1/2015Missed Organ Referral14%
102/1/2015Missed Tissue Referral14%
112/1/2015Pre-Approach416%
123/1/2015Late Organ Referral#DIV/0!
133/1/2015Late Tissue Referral#DIV/0!
143/1/2015Missed Organ Referral#DIV/0!
153/1/2015Missed Tissue Referral#DIV/0!
163/1/2015Pre-Approach#DIV/0!
174/1/2015Late Organ Referral#DIV/0!
184/1/2015Late Tissue Referral#DIV/0!
194/1/2015Missed Organ Referral#DIV/0!
204/1/2015Missed Tissue Referral#DIV/0!
214/1/2015Pre-Approach#DIV/0!
Kijindoragon
Cell Formulas
RangeFormula
D2=C2/SUMIF(A$2:A$21,A2,C$2:C$21)


than create Name range 'Data' referring to =OFFSET(Kijindoragon!$D$1,1,0,COUNTIF(Kijindoragon!$D:$D,">0"))

Now in your chart Series values is ='whatever_is_the_name_of_your_workbook.xlsm'!Data
And for the Horizontal (category) Axis labels simply use =Kijindoragon!$A$2:$B$21 or whatever range is used from January to December. (note change tab name as required)

The chart will display a column only for those month with data.

Would that work for you?
 
Upvote 0
Will that work for this chart? The months are across the top because I'm charting the variables on the left together every month.
[TABLE="width: 1213"]
<colgroup><col><col><col><col><col><col><col span="3"><col><col><col><col><col></colgroup><tbody>[TR]
[TD]
Column1
[/TD]
[TD]Total[/TD]
[TD]January[/TD]
[TD]February[/TD]
[TD]March[/TD]
[TD]April[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD]July[/TD]
[TD]August[/TD]
[TD]September[/TD]
[TD]October[/TD]
[TD]November[/TD]
[TD]December[/TD]
[/TR]
[TR]
[TD]Late Organ Referral[/TD]
[TD="align: right"]50%[/TD]
[TD="align: right"]44%[/TD]
[TD="align: right"]53%[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
[TR]
[TD]Late Tissue Referral[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]0%[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
[TR]
[TD]Missed Organ Referral[/TD]
[TD="align: right"]4%[/TD]
[TD="align: right"]0%[/TD]
[TD="align: right"]5%[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
[TR]
[TD]Missed Tissue Referral[/TD]
[TD="align: right"]21%[/TD]
[TD="align: right"]33%[/TD]
[TD="align: right"]16%[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0!
[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
[TR]
[TD]Pre-Approach[/TD]
[TD="align: right"]25%[/TD]
[TD="align: right"]22%[/TD]
[TD="align: right"]26%[/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[TD="align: center"]#DIV/0![/TD]
[/TR]
</tbody>[/TABLE]

Sorry for no borders on the chart.
 
Upvote 0
Given in A1:

Excel 2013
ABCDEFG
1total1/1/20152/1/20153/1/20154/1/20155/1/2015
2Late Organ Referral50%44%53%#DIV/0!#DIV/0!#DIV/0!
3Late Tissue Referral0%0%0%#DIV/0!#DIV/0!#DIV/0!
4Missed Organ Referral4%0%5%#DIV/0!#DIV/0!#DIV/0!
5Missed Tissue Referral21%33%16%#DIV/0!#DIV/0!#DIV/0!
6Pre-Approach25%22%26%#DIV/0!#DIV/0!#DIV/0!
Kijindoragon


Named ranges are:
LOR =OFFSET(Kijindoragon!$A$2,0,1,,COUNTIF(Kijindoragon!$2:$2,">=0"))
LTR =OFFSET(Kijindoragon!$A$3,0,1,,COUNTIF(Kijindoragon!$3:$3,">=0"))
MOR =OFFSET(Kijindoragon!$A$4,0,1,,COUNTIF(Kijindoragon!$4:$4,">=0"))
MTR =OFFSET(Kijindoragon!$A$5,0,1,,COUNTIF(Kijindoragon!$5:$5,">=0"))
PA =OFFSET(Kijindoragon!$A$6,0,1,,COUNTIF(Kijindoragon!$6:$6,">=0"))

Chart Legend Entries (Series)
Series Values 1 ='whatever_is_the_name_of_your_workbook.xlsm'!LOR
Series Values 2 ='whatever_is_the_name_of_your_workbook.xlsm'!LTR
Series Values 3 ='whatever_is_the_name_of_your_workbook.xlsm'!MOR
Series Values 4 ='whatever_is_the_name_of_your_workbook.xlsm'!MTR
Series Values 5 ='whatever_is_the_name_of_your_workbook.xlsm'!PA

Axis Label range is =Kijindoragon!$B$1:$N$1

Note:
Just a remark, keeping data in multiples Columns and few Rows may prove less efficient with bigger dataset...
 
Upvote 0
Do I just copy the named ranges into all of the values? I'm sorry I'm so new to this... What I think you mean is

column b2 through b# is =offset....
column c2 through c# is =offset....

etc.

Are those abbreviations LOR LTR part of the field or are you just abbreviating that?

For the chart legend entries, do I need to specify the sheet as well as the workbook?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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