Creating charts with multiple groups of stacked bars (77241)



The information in this article applies to:

  • Microsoft Office Excel 2003
  • Microsoft Excel 2002
  • Microsoft Excel 2000
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 5.0

This article was previously published under Q77241

SUMMARY

Normally, data series in a stacked column or bar chart have 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.

The following sample data produces 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, 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
				


Microsoft Excel 97 for Windows

To create the chart, follow these steps:

  1. Select cells A1:E11. Click Chart on the Insert menu.
  2. Click the Standard Types tab. Click Stacked Column under Chart Sub-Type. Click Next.
  3. In step 2 of the Chart Wizard, click the Series tab. In the Series list, click X, and then click Remove.
  4. Type the following in the Category (X) Axis Labels box:

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

    Then, click Next.
  5. Click Next to move to step 4 of the Chart Wizard.
  6. Click As New Sheet and click Finish.

Microsoft Excel Versions 5.0 and 7.0

To create the chart, follow these steps:

  1. Select cells A1:E11. Point to Chart on the Insert menu, and then click As New Sheet.
  2. In step 1 of Chart Wizard, click Next.
  3. In step 2 of Chart Wizard, click Column, and then click Next.
  4. Click to select either the third or fifth view in step 3 of Chart Wizard, and then click Next.
  5. In step 4 of Chart Wizard, click the up arrow next to "Use Column(s) for Category (X) Axis Labels" until the number is incremented to 1, and then click Finish.

Microsoft Excel Versions 4.0 and Earlier

To create the chart, follow these steps:

  1. Select the data in cells A1 through E11.
  2. On the File menu, click New and click Chart in the New dialog box.
  3. On the Gallery menu, click Column and select the third or fifth option.

MORE INFORMATION

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 above chart were moved to the first row of each group, the chart would still have two stacks per group. However, the first stack would contain three columns and the second stack would contain only one column.

REFERENCES

Microsoft Excel 7.0

For more information about column and bar charts in Microsoft Excel, click Answer Wizard on the Help menu and type:

   column charts
   bar charts
				


Microsoft Excel 5.0

For more information about column and bar charts in Microsoft Excel, click the Search button in Help and type:

   column charts
   bar charts
				

Modification Type:MinorLast Reviewed:8/15/2005
Keywords:kbchart kbinfo KB77241