Excel 2010: Shading per series for Bar Charts - excel

I have a table of data similar to this:
I want to create a bar chart like this:
But I get this:
or, when I add major gridlines, I get this:
However, I want a quick way to visually differentiate between the different quarters (Q1... Q4) by shading them with a different background color each or marking a border around them.
I don't want to export the chart as an image and edit it because:
1. This is a weekly report, it would be very repetitive and error prone.
2. It would be time consuming when I need to do it for 100s of records.
3. My manager prefers the data and the chart to be sent as part of the report. Hence, changing it to other formats is not possible.
Is it possible to create such a graph using Excel 2010? If so, how? I don't mind writing a macro for this, but am currently lost on the approach.

If you want to do something like this:
It's a bit tricky, but can be done. First you must add a fourth data series so you have the data like this:
Then you have to put the three "real" data series in the secondary axis. You must set the maximum values both in secondary and primary axes to the same value (30 in my example). Next, you delete the secondary axis. And finally, in the fourth series settings you let it overlap and put the separation to zero. Sorry, I don't know the exact english name of the settings, as my Excel is not in english.

Related

Excel data - cleaning data with multiple values for numerous instances

I have a data set which is related to force applied vs distance traveled.
When the data was created the measurement software has provided multiple values for distance traveled as the force increases, then in some cases the data has no values for distance at the force values.
I have several data sets which look like this.
The data looks like this
I want to 'clean the data so I can create a graph with all 3 samples in columns the same height so it is easy to edit and make scatter graphs from.
I tried to clean the data by using VLOOKUP to create a column of force values at each 0.5N, but when I do this I end up with a large table that has lots of missing data points, when I make the graph from this there are lots of blank areas which don't seem to plot correctly.
The VLOOKUP data looks like this
The graph looks like this
Is there a better way to do this which will give me a better looking data set which is better for creating a graph from?
I have about 30 sets of data, so any info that you have would be greatly appreciated.
Why make the columns equal length.
If you plot the three samples with the data as given, an XY graph should look OK:
If there's some other reason to make the columns equal length, I'd "fill in the blanks" using the FORECAST or GROWTH functions, or use a trendline.
You can use IFERROR to insert something in place of the #N/As. For example, you could use =IFERROR(VLOOKUP(A1,D:D,1,FALSE),0) to add a zero in place of the #N/As

Prevent Excel from changing x-axis on a dynamic chart

I wanted to make a dynamic chart that plots out the graph of a standard curve for a bio assay we perform frequently. Often to boost the fit of the curve you may drop one or two data points on either end of the data set. So using vlookups and if statements I have a scheme that performs that data trimming, such that my data always starts in Row 1 and the column length simply shortens.
My table works great, but my xy scatter chart goes bananas on these changes. I have the plot on a log log scale, which looks fine if the full data set is present. I lose the x axis detail when I perform a trim. The x- axis then resets to range of 1 to length of my data set.
How can I prevent this?
UPDATE
I added some information. I know there are VBA ways to do this but I would prefer to keep the spreadsheet as simple as possible. I would think excel should be able to handle this.
So if I have a bad fit I may want to trim the data series either from the beginning or end of the data set. I accomplish that with the spinner buttons to dynamically change the table but the following happens
My formula that updates the columns looks like the following. Its messy.
=IF(ISNA(IF(VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1>8-($B$5-1),"",INDEX(C$4:C$11,VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1))),"",IF(VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1>8-($B$5-1),"",INDEX(C$4:C$11,VLOOKUP(F6,$C$4:$D$11,2,FALSE)+1)))
In the formulas use NA() instead of "". Filling cell with "" does not result in a true empty cell and is the reason why you are experiencing issues with your chart.
Hope that helps.
I may be missing the obvious here, but just hard-code the graph with a range of your choosing. In the sample screenshot, making the graph auto defaults the max range to 100,000. I went in and hard-coded the maximum to 50,000 (circled). Afterwards, the 5th data point is not displayed in the chart. Doesn't matter what the data shows at this point.

tableau waterfall chart with mixed colors

I started working with Tableau and found out how to do waterfall charts (Gantt-charts, rolling sum for y-axis and negative value for length of bar. See here: tableau tutorial waterfall charts)
Now my question would be if there is a possibility to split the color by some category? To show what I'm talking about I set up some waterfalls with excel powerpoint. The first one without a split by a category and the second one with a split by category.
I would appreciate any help
It is as simple as dragging the right field to Color, and adjusting the table calculation.
If it's a simple running sum (for the positioning of the bar), you need to go edit the table calculation, select Compute using Advanced..., then drag all fields to addressing. Then you need to sort your data by the master field (in your case the one that has Coffee, Coke,...) maximum (ascending or descending, doesn't matter).
This way you guarantee that the running sum is being applied to one category at a time (at not one color at a time or something like that).
It's really important to understand the concept of table calculations so you can understand what's going on, how Tableau is calculating stuff. Read this http://onlinehelp.tableausoftware.com/current/pro/online/en-us/help.htm#calculations_tablecalculations_understanding_addressing.html
And if you actually understand what you're doing, it's easier to find a solution. For instance, this hack of Gantt Chart to make a waterfall. What goes on rows the chart will understand at starting point of the data, and what goes on size is, well, the size of the chart. You put negative values cause you want the bar to go down.
That being said, dragging a field to color won't mess up with the size, but it will mess up with the running sum used to determine the starting points. How to solve it? make it calculate all the colors together. How to make it? Understand table calculations and reach my solution.
This is the simple approach, if your database or fields have some peculiarity, this might not work perfectly, and you'll need to explain so I can try to understand how to solve

Multiple axis line chart in excel

I'm looking for a multiple axis line chart similar to the one in the image below, (which is a javascript chart made by amcharts).
Does excel have an option to draw charts line these? Note there are 3 Y axes, and 3 line charts allowing you to compare data.
Is it possible to get more than 3 data points, each with unique axis on one chart ?
It is possible to get both the primary and secondary axes on one side of the chart by designating the secondary axis for one of the series.
To get the primary axis on the right side with the secondary axis, you need to set to "High" the Axis Labels option in the Format Axis dialog box for the primary axis.
To get the secondary axis on the left side with the primary axis, you need to set to "Low" the Axis Labels option in the Format Axis dialog box for the secondary axis.
I know of no way to get a third set of axis labels on a single chart. You could fake in axis labels & ticks with text boxes and lines, but it would be hard to get everything aligned correctly.
The more feasible route is that suggested by zx8754: Create a second chart, turning off titles, left axes, etc. and lay it over the first chart. See my very crude mockup which hasn't been fine-tuned yet.
The picture you showd in the question is actually a chart made using JavaScript. It is actually very easy to plot multi-axis chart using JavaScript with the help of 3rd party libraries like HighChart.js or D3.js. Here I propose to use the Funfun Excel add-in which allows you to use JavaScript directly in Excel so you could plot chart like you've showed easily in Excel. Here I made an example using Funfun in Excel.
You could see in this chart you have one axis of Rainfall at the left side while two axis of Temperature and Sea-pressure level at the right side. This is also a combination of line chart and bar chart for different datasets. In this example, with the help of the Funfun add-in, I used HighChart.js to plot this chart.
Funfun also has an online editor in which you could test your JavaScript code with you data. You could check the detailed code of this example on the link below.
https://www.funfun.io/1/#/edit/5a43b416b848f771fbcdee2c
Edit: The content on the previous link has been changed so I posted a
new link here. The link below is the original link
https://www.funfun.io/1/#/edit/5a55dc978dfd67466879eb24
If you are satisfied with the result you achieved in the online editor, you could easily load the result into you Excel using the URL above. Of couse first you need to insert the Funfun add-in from Insert - My add-ins. Here are some screenshots showing how you could do this.
Disclosure: I'm a developer of Funfun
There is a way of displaying 3 Y axis see here.
Excel supports Secondary Axis, i.e. only 2 Y axis. Other way would be to chart the 3rd one separately, and overlay on top of the main chart.
An alternative is to normalize the data. Below are three sets of data with widely varying ranges. In the top chart you can see the variation in one series clearly, in another not so clearly, and the third not at all.
In the second range, I have adjusted the series names to include the data range, using this formula in cell C15 and copying it to D15:E15
=C2&" ("&MIN(C3:C9)&" to "&MAX(C3:C9)&")"
I have normalized the values in the data range using this formula in C15 and copying it to the entire range C16:E22
=100*(C3-MIN(C$3:C$9))/(MAX(C$3:C$9)-MIN(C$3:C$9))
In the second chart, you can see a pattern: all series have a low in January, rising to a high in March, and dropping to medium-low value in June or July.
You can modify the normalizing formula however you need:
=100*C3/MAX(C$3:C$9)
=C3/MAX(C$3:C$9)
=(C3-AVERAGE(C$3:C$9))/STDEV(C$3:C$9)
etc.
Taking the answer above as guidance;
I made an extra graph for "hours worked by month", then copy/special-pasted it as a 'linked picture' for use under my other graphs. in other words, I copy pasted my existing graphs over the linked picture made from my new graph with the new axis.. And because it is a linked picture it always updates.
Make it easy on yourself though, make sure you copy an existing graph to build your 'picture' graph - then delete the series or change the data source to what you need as an extra axis. That way you won't have to mess around resizing.
The results were not too bad considering what I wanted to achieve; basically a list of incident frequency bar graph, with a performance tread line, and then a solid 'backdrop' of hours worked.
Thanks to the guy above for the idea!
Best and Free ( maybe only) solution for this is google sheets.
i don't know whether it plots as u expected or not but certainly you can draw multiple axes.
Regards
keerthan

how to create percentage bar chart in excel, similar to "100% stacked column" but with one variable against total value

I thought over a lot for this case, I need to plot a series as percentage value of another series.
e.g, series A is the capacity and B is the usage. I want a percentage plot of B on A. Initially I did this by creating a 100% stack chart with series B vs (A-B). I computed (A-B) on a separate column and used that as a series for this purpose. So far so good.
But now I want to generate multiple charts like this (say 12 different graphs for 12 months' usage). I have 12 columns of usage data and one column of fixed capacity data.
Is there a way to auto-generate this chart without having to create 12 intermediate columns with formula. It seems logical that Excel should have a chart type for representing A on B, just as they have one for A,B on A+B.
Sorry if I am too lengthy or confusing in my description. I did my best here to explain.
Actually I am trying to do the same thing I figured it out. If you have Excel 2007 (not sure if this feature is available in older versions). Select all 3 colums, 1 with the names of your variables, total count, and subtotal of what you are counting. Select column chart. Once the chart is created, right click to format the data series. Under series options there is a slidebar for series overlap, change this value to 100% and wahla, the the 2nd series becomes a percent of the total. Hope this helps!
Excel has common chart types, but even Microsoft doesn't have the resources to provide every possible combination of charting styles. And users are confused enough with the currently available styles.
Excel charts plot the data that they are given. If you need to plot A as a percentage of B, you will need to compute the percentage in a range, and plot this range.
The way I would do this is not to modify the ranges on the worksheet at all.
Write a new function that creates the modified range data you need so that you can return this and use it inside of ApplyTemplate method when creating the chart. The only downside to this is you would need to run a macro/vsto ribbon button to update the chart. as opposed to getting that behaviour for free with a worksheet bound approach.

Resources