In Excel, how do I make a stacked bar graph with 2 bar that have different data points? - excel

So I have the following data:
I made 2 stacked bars with these data, notice both bar have different data points, my question is, how do I merge them to the same graph so I can compare them?
I would like something to look like this, is it possible?:

A simple solution would be to have all 7 columns in your data table, and then fill in 0's for the values that don't apply to one row or the other.

Related

Combining a stacked chart with a bar chart

I'm using reportbuilder 3
I was wondering if there was a way to combine a stacked bar chart with a normal bar chart.
I've tried a work around which, whilst serves the purpose, doesn't to me, look particularly professional. If its not possible to combine the two I'd be willing to listen to any other workarounds, for example like getting the two charts closer together, no gap in the horizontal axis, having the vertical axis of the stacked chart to mirror that of the bar chart (the bar chart currently extends past the vertical axis in the stacked chart). Any suggestions welcome.
This is my design view, stack bar chart to the left and normal bar chart to the right
This is the output
This may not be achievable in your scenario but as I don;t know what your data looks like, it's hard to tell.
My approach would be to arrange the dataset to contain two categories and have one category contain one series value and the main category include everything except the main series value.
To create this data I created a dataset with the following query.
DECLARE #t TABLE(ColA varchar(10), ColB varchar(10), Amount int)
INSERT INTO #t VALUES
('Targeted', 'Cars', 1170),
('Targeted', 'Bikes', 2598),
('Targeted', 'Trains', 6515),
('Others', 'Others', 14069)
SELECT * FROM #t
I then added a single stacked column chart as follows
This gives us the following result.
It has the advantage that the scales will be based on all amounts and its very simple to do. It may however be an issue if you need to independently format the two sets of data.

Excel bar chart with two y axis & split areas

I have data like this.
source table
I would like to make a bar chart like below.
Chart I want
The problem is that since Dioxin ranges are way smaller than the others,
I can't look at the dioxin data properly.
In order to solve this problem, I would like to separate the chart areas into two and make a line between two areas with ranges of Dioxin shown in the right y axis.
How do I do this?

Excel scatterplot graph update automatically

My problem is as follows:
The user inputs two numbers between 2 and 25, these numbers are used to create a grid. Every point on the grid has (x,y) coordinates. Based on the amount of points the user chose, my excel sheet is filled up with up to 25x25 (x,y) coordinates.
Example: A 6x7 grid is chosen by the user, the table is filled with 42 (x,y) coordinates and all other values in the table are set to "".
Now I want to use a scatterplot with lines connecting each array to plot the data.
Problem 1: If I only select the 6x7 part of the table that has values in it and create the scatterplot the result is correct. Until the user specifies a different grid, for example 8x9, then the graph is obviously missing two rows and two columns of input data.
Problem 2: If I select the entire 25x25 part of the table, including all the "" values, the graph axes get messed up. The y-axis works properly, but the x-axis shows sequential values (0-7) instead of the x-coordinates.
Problem 3: If I replace all the "" values in the table to 0 or NaN and plot the entire table the axes are correct, but the lines between the scatter data get messed up.
Question:
Is there a way to automatically change the input data for the plot, or is there a way to correctly display the values on the x-axis if I select all the data?
Not sure this will work in your case, but it's worth a try, especially since no one's addressed your post in 3+ hours. I've had success with this approach: 1) charting the largest data set, 2) copying the resulting chart, and 3) trimming the data it draws from to produce all smaller data sets.
To get this to work takes a lot of thought in laying out that largest data set so that all the other plots follow as needed. To illustrate, I've somewhat mimicked your data and in the animated gif I show largest data set, plus 2 others produced by copying it. Then I demonstrate how to make the second one, including the rescaling required to make all plots scaled equally. Notice that I've arranged things so that only one set of x-values feeds all the series. If you can do this, it makes working with the Excel's interface much easier.
After wrestling with it all night I came to the following solution:
Instead of setting all the empty cells to "" or zero the cells should be be set to #N/A (not available). The graph properly ignores the #N/A cells exactly like I want it to and updates when values are entered into them.

How can I create a graph in excel that uses multiple columns and does stacked columns?

I need a graph that has multiple columns and also has stacked columns. Here is a photo to help illustrate what I am looking for: Graph Examples As you can see in the photo there are two graphs. I want them to become one I wanted the Stacked there to be a total of 2 columns for each data series. I want the front column to have Data C3:C14 with D3:D14 Stacked on top of it, Then a column in the back that has B3:B14.
Simple answer is you can not so you have to cheat.
Can you upload the spreadsheet?

Excel Chart doesn't keep format

I have a table (came from a pivot table) where I have formatted the column 4 cells to show 1 billion as 1. But when I select the table and insert a chart, I am getting my units in millions. So the 14.8 billion number for Mexico is showing up as 14,800 on the chart. Why might this be happening and how can I fix this? This is also making all my other bars negligibly small. Note that the first three columns are not in billions and are totally different things. Some are percentages, some are other small numbers.
Table:
Chart:
You need a secondary horizontal axis and some formatting on the Axes.
In Excel 2013
First change the Chart Type to Combo and select Clustered Bar for both sets of data, then Check
Secondary Axis for the Percentage Series.
Then set up the axis limits so they match, e.g.
Percentage: min -.5 max 2
Billions: min -5e9 max 20e9
Then set the percentage format on the source data to a custom Number format of "";(0)%;0%
Then set the Billions format as 0,,,;"";0
You will get something like this:
EDIT
Now that we have the general principles, we can apply them to your specific data.
I will also switch to Excel 2010 do show the different menus.
The data selection looks like this
Select the non-Billion series (plural!) and check the secondary axis
If the larger data is always positive then you can use custom formatting to clean up the axis
Align the primary and secondary axes so that the grid lines match on both
The end result is clean and readable.
Mixing percentages and numbers for the smaller numbers is not handled by this but I would suggest that that would be confusing anyway?
The simplest way to fix this might be to plot cells containing the billions values divided by 10^9 rather than to plot the billions themselves, though via a secondary axis may be possible.
Using Excel 2007. For the purple bars, the example on the left uses ColumnE values, on the right ColumnF values. E1 contains =F1/10^9 and F1 contains =14800000000:
It appears that there are 3 questions here: 1) "Why might this be happening", 2) "how can I fix this", and 3) something like "how can I plot data which lie on two widely differing ranges, and make them all reasonably visible anyway", even if there was no explicit question on this.
There are several ways to solve issue #2 about the units (e.g., billions) and numbers (e.g., 14.8 vs. 14,800.0) shown in the axis, each one with its own pros and cons:
Use Format Axis -> Axis Options -> Display units.
This might be the answer to your issue #1 as well, you might have the following selection: Display units -> Millions, and unchecked Show display units... Otherwise, I wouldn't know why you chart shows what it shows.
Use faked tick marks, as indicated in the (excellent) site of Jon Peltier
http://peltiertech.com/Excel/Charts/ArbitraryAxis.html
It gives detailed instructions on how to create tick marks on an axis with arbitrary labels (which may be text, numbers, etc.), which is more generic than what the OP wants here. In this particular case, the labels will be the desired numbers.
Create new cells containing data that would be plotted exactly the way you want.
As for your issue #3, I guess the only option is to have a Secondary Axis (see the answer by pnuts).
Thus, to come up with the best final chart for you might use a combination of one of the options I gave here and a secondary axis.

Resources