Microsoft Knowledge Base

XL: Inserting a Vertical Line in Microsoft Excel Chart

Last reviewed: March 27, 1997
Article ID: Q124112
5.00 5.00c 7.00 | 5.00 5.00a
WINDOWS         | MACINTOSH
kbusage

The information in this article applies to:

  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for the Macintosh, versions 5.0, 5.0a
  • Microsoft Excel for Windows NT, version 5.0
  • Microsoft Excel for Windows 95, version 7.0

SUMMARY

In Microsoft Excel, you can add a vertical line to a chart such that the line has a mathematical relationship to the data on your chart. You can use this line to show the dividing point between historical data and projected data.

To create this line, follow the procedure in the "More Information" section of this article.

NOTE: This feature is not available in earlier versions of Microsoft Excel 5.0.

MORE INFORMATION

  1. Enter the following sample data in a new Microsoft Excel worksheet.

    Sample Data -----------

       A1: a   B1: 1
       A2: B   B2: 2
       A3: c   B3: 3
       A4: d   B4: 4
       A5: e   B5: 5
       A6: 1.5 B6: =CEILING(MAX(B1:B5),1)
       A7: 1.5 B7: =IF((MIN(B1:B5)>0)*(MIN(B1:B5)<=1),0,MIN(B1:B5))
    
        NOTE: The formula in cell B6 sets the maximum to the round up value of
        the maximum of your data. The formula in cell B7 will set the minimum
        value of the vertical line equal to zero if the minimum value of your
        data series (B1:B5) is less than or equal to 1 and greater than 0.
    
    

  2. Select cells A1:B5, and choose the ChartWizard tool.

  3. With the ChartWizard tool active, select a location for the chart, and then choose Finish.

  4. Select cells A6:B7, and choose Copy from the Edit menu.

  5. Select the chart object, and choose Paste Special from the Edit menu.

  6. In the Paste Special dialog box, select the following options

        - Under Add Cells As, select New Series
        - Under Values (Y), select Columns
    

    and select the "Categories (X Labels) In First Column" check box.

  7. Activate the Chart Object, select the new column, and choose Chart Type from the Format menu. In the Chart Type dialog box, select the following options and choose OK:

        - Under Apply to, select Selected Series
        - Select the XY (Scatter) chart type
    

  8. With the new series selected, choose Selected Data Series from the Format menu, select the Patterns tab, and select the following options:

        - Under line, select Custom
        - Under Marker, select None
    

To adjust where the line is plotted, change the numbers in cells A6:A7.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 5.00
Keywords : kbusage
Version : 5.00 5.00c 7.00 | 5.00 5.00a
Platform : MACINTOSH WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 27, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.