Microsoft KB Archive/186974

= XL98: How to Create a Chart with Multiple Groups of Stacked Bars =

Article ID: 186974

Article Last Modified on 9/11/2002

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q186974





SUMMARY
Normally, data series in a stacked column or bar chart contain one stack per category. However, it is possible to arrange your data so that the chart appears to have more than one stack per category. This article includes and example with steps for creating a chart with multiple stacks per category.



MORE INFORMATION
When you enter the following sample data and create a chart, the chart contains ten different stacks with two columns each. The first column has the Y2 value stacked over the Y1 value; every other column has the Y3 value stacked over the Y4 value.

To create the chart, follow these steps:

 Start Microsoft Excel and create a new workbook.  Type the following into a worksheet:      A1 :  X      B1 :  Y1     C1 :  Y2     D1 :  Y3     E1 :  Y4      A2 :  X1     B2 :  1      C2 :  2      D2 :         E2 : A3 :        B3 :         C3 :         D3 :  3      E3 :  4 A4 : X2     B4 :  1      C4 :  2      D4 :         E4 : A5 :        B5 :         C5 :         D5 :  3      E5 :  4 A6 : X3     B6 :  1      C6 :  2      D6 :         E6 : A7 :        B7 :         C7 :         D7 :  3      E7 :  4 A8 : X4     B8 :  1      C8 :  2      D8 :         E8 : A9 :        B9 :         C9 :         D9 :  3      E9 :  4 A10: X5     B10:  1      C10:  2      D10:         E10: A11:        B11:         C11:         D11:  3      E11:  4  Select cells A1:E11. On the Insert menu, click Chart. Click the Standard Types tab in the Chart Type dialog box, and click Stacked Column under Chart Sub-Type. Click Next. In step 2 of the Chart Wizard, click the Series tab. In the Series list, click X, and then click Remove. Type the following in the Category (X) axis labels box:

=Sheet1!$A$2:$A$11

Then, click Next.</li> Click Next to move to step 4 of the Chart Wizard.</li> Click As new sheet and click Finish.</li></ol>

Description of the Chart
The labels X1 through X5 appear along the horizontal axis. Y1 through Y3 appear in the legend as series names. You can extend this chart to include more groups by adding more data in two rows for each new group.

The number of rows per category label defines the number of stacks per group. To add another group of two bars, insert a row before each X label and add two more columns of data in the new row, such as Y5 and Y6.

The number of columns of data per row defines the number of columns in each stack. For example, if the values for Y3 in the sample chart are moved to the first row of each group, the chart will have two stacks per group. However, the first stack would contain three columns and the second stack would contain only one column.

<div class="references_section">