Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
61 views

Excel User Tips - Chart - and - Graphic

1) Excel 2002 introduced the ability to insert graphics directly into page headers and footers. Prior versions required workarounds like printing on letterhead or using custom fonts. 2) Another workaround involved designating rows to print at the top of each page and inserting a graphic. This required adjusting print margins and headers. 3) New features in later versions made inserting graphics easier, but the row trick still works for older Excel versions.

Uploaded by

Leon Fourone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Excel User Tips - Chart - and - Graphic

1) Excel 2002 introduced the ability to insert graphics directly into page headers and footers. Prior versions required workarounds like printing on letterhead or using custom fonts. 2) Another workaround involved designating rows to print at the top of each page and inserting a graphic. This required adjusting print margins and headers. 3) New features in later versions made inserting graphics easier, but the row trick still works for older Excel versions.

Uploaded by

Leon Fourone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Excel User Tips

Add graphics to your page header


Note: Excel 2002 has built-in support for graphics in the page header or footer.

Prior to Excel 2002, a common question was: "How can I insert my company's logo
into the page header?" The simple answer: You can't. But there are a few ways to
fake it.

Perhaps the simplest solution is to print your reports on company letterhead -- paper
that's preprinted with your logo. Another option is to use a custom font with a
character that displays your logo. You can create this custom font using shareware or
commercial font creation programs, or hire a professional to do the job. But even
professionals will be limited to the use of simple line graphics.

Another way to display a graphic within a page header involves a bit of trickery. Excel
lets you specify that one or more rows print at the top of every page (these are
known as print titles). You can take advantage of this option and use a print title row
to store your logo.

The figure below shows a graphic that will print at the top of each page. Note that the
row height is adjusted to fit the image.

Here are the basic steps.

First, specify the rows for the print titles. Choose File, Page Setup and click on the
Sheet tab in the Page Setup dialog box. This example uses the first two rows as the
print titles, so that both the graphic (row 1) and the column headers (row 2) will
appear at the top of every printed sheet.

You can also combine standard header options (found in the Header/Footer tab of the
Page Setup dialog) with this title rows trick -- but make sure the graphic doesn't
obscure the text. For example, if the graphic sits on the left side of the page (as in the
example), you'll need to put the page numbers in the right or center sections of the
sheet's header.

Now here's where it gets tricky. Click the Print Preview button to preview your
worksheet. In the preview window, click the Margins button to display the margin
handles, which let you adjust the margins and column widths. Specifically, you'll need
to adjust the top margin and the header margin, represented by horizontal lines in the
preview window. Normally, the upper horizontal line represents the header margin,
and the second horizontal line the top margin. Drag these lines up or down until the
page header looks correct. In the figure linked to above, the header margin has been
moved above the page margin, so the page margin overlaps with the header margin.
The result is that the graphic will align vertically with the normal header text (in the
example shown, the page number).

Excel User Tips_Chart_and_Graphic


Page 1 of 15
If your worksheet happens to be wider than a page, you'll need to copy the graphic
and paste it to the cell that occupies the same location on the subsequent pages.

If all this sounds too complicated, consider upgrading to Excel 2002.

Creating a linked picture of a range


Many users overlook a useful Excel feature that can create a live "snapshot" of a
range and placing it anywhere you like.

To use this feature:

1. Select a range of cells

2. Choose Edit, Copy

3. Hold down the Shift key, and then choose Edit, Paste Picture Link.

The result is an image of the selected range that will reflect any subsequent changes
to the source.

This technique is great for printing noncontiguous ranges on a single page. After
creating a series of linked pictures of ranges, set them to print on one page.

Note: The Paste Picture Link command is a hidden command, and it appears on the
Edit menu only if you press the Shift key.

Creating a non-graphic chart directly in a range


This tip describes how to create a non-graphic chart. It uses formulas to display crude
"bars" directly in a range of cells.

The figure below shows an example of what you can produce with his technique.

The formulas in columns E and G graphically depict monthly budget variances by


displaying a series of characters in the Wingdings font. The number of characters
displayed is determined by an IF function.

To re-create this chart in Excel, enter the data shown in columns A through D, and
then enter the following formulas:
E2: =IF(D2<0,REPT("n",-ROUND(D2*100,0)),"")
F2: =A2
G2: =IF(D2>0,REPT("n",-ROUND(D2*-100,0)),"")

Excel User Tips_Chart_and_Graphic


Page 2 of 15
Assign the Wingdings font to cells E2 and G2, and then copy the formulas down the
columns to accommodate all the data. Right-align the text in column E, and adjust
any other formatting as you like.

Depending on the numerical range of your data, you may need to change the scaling.
Experiment by replacing the '100' value in the formulas. You can, of course, substitute
any character you like for the "n" in the formulas to produce a different character in
the chart.

Creating a thermometer style chart


Most people are familiar with "thermometer"-style graphs, which show the percentage
of a project completed. It's easy to make such a display in Excel. The key is to create
a chart that uses a single cell (containing a percentage value) as a data series.

The example below tracks daily progress toward a goal: 1000 new customers in a 15-
day period.

Cell B18 contains the goal value. Cell B19 contains a simple sum formula:
=SUM(B2:B16)
Cell B21 contains the following formula, which calculates the percentage of the goal
attained
=B19/B18
As new data is entered in column B, the formulas display the current results.

To create the chart:

1. Enter the formulas listed above, along with the worksheet's sample data.

Excel User Tips_Chart_and_Graphic


Page 3 of 15
2. Select cell B21, and click the Chart Wizard button. Notice the blank row
preceding cell B21. If you fail to include this blank row, Excel will use the
entire data block--not just the single cell--to construct the chart. Since B21 is
isolated from the other data, the Chart Wizard uses only the single cell.

3. In step 1 of the Chart Wizard dialog, specify a Column chart and a Clustered
Column subtype (the first choice).

4. Click Next twice, and then in step 2 make additional adjustments: Add a Chart
Title (Title tab), dump the Category (x) axis (Axes tab), delete the legend
(Legend tab), and specify Show value (Data Labels tab). Click Finish to view
the chart.

5. Double-click the column to display the Format Data Series dialog box.

6. Click the Options tab, and set the Gap width to 0 (this setting instructs the
column to occupy the entire width of the plot area).

7. To change the pattern used in the column, click the Patterns tab and make
your selection. The example shown here uses a gradient fill effect.

8. Double-click the vertical axis to bring up the Format Axis dialog. In the Scale
tab of the Format Axis dialog, set Minimum to 0 and Maximum to 1.

Creating a transparent chart series


Excel charts do not support color transparency. When you apply a color to a bar or
column chart series, the color must be a solid color. Although the Fill Effects dialog
box includes Transparency controls, these controls are disabled.

This tip describes how to make a bar or column series transparent by pasting a
picture. The figure below shows a chart after the column series has been made
transparent. Notice that the gridlines show through the columns.

Excel User Tips_Chart_and_Graphic


Page 4 of 15
Following are the steps required.

1. Create the chart as usual. It must be a bar chart or a column chart.


2. Display the Drawing toolbar, and add a Rectangle AutoShape to your
worksheet.
3. Double-click the Rectangle to display the Format AutoShape dialog box.
4. In the AutoShape dialog box, select the Colors and Lines tab.
5. Use the Color control to select a color.
6. Use the Transparency scrollbar to specify a transparency setting
7. For best results, use the Line Color control and specify No Line.
8. Close the Format AutoShape dialog box.
9. Select the AutoShape. Press Shift, and select Copy - Picture (this command is
available only when the Shift key is pressed). Accept the default settings.
10. Activate your chart and click the bar or column series.
11. Choose Edit - Paste, to paste the copied AutoShape.
12. If you formatted the AutoShape without a border, you may prefer to add a
border to your chart series. Double-click the series and use the Patterns tab in
the Format Data Series dialog box.

In the example below, the transparent AutoShape was formatted with a rainbow
gradient.

Excel User Tips_Chart_and_Graphic


Page 5 of 15
Creating Combination Charts
A combination chart is a chart that combines two or more chart types in a single chart
-- for example, a chart that has a line series and a column series. When you choose
the Custom Types tab in the first step of the Chart Wizard, you'll find the following
combination charts listed:

• Column - Area
• Line - Column
Many users think that these are the only two combination charts that are possible. In
fact, you have a great deal of flexibility in creating combination charts. They key is
understanding how the Chart - Chart Type command works. When you select this
command, it works in either of two ways:

If a series is selected in the chart, the chart


type that you choose applies only to the selected
series.

Or...

If anything other than a series is selected, the chart


type that you choose applies to all series in the chart.

For example, assume you want to create a combination chart that displays a column,
a line, and an area.

1. Start by creating a column chart.


2. Select the second chart series and choose Chart - Chart Type. Select a line
chart type for that series.
3. Select the third series and repeat this command, but choose an area chart
type. The result is a combination chart that shows three different chart types.
Note:
Not all chart types can be used in a combination chart. For example, Excel does not
allow any of the 3-D chart types to be used in a combination chart.

Excel User Tips_Chart_and_Graphic


Page 6 of 15
The figure below carries this concept to the extreme. This combination chart displays
five series, and each series uses a different chart type. This chart, of course, is
provided for demonstration purposes only. I can't think of any situation that would
warrant such a confusing chart!

Display multiple charts on a single Chart sheet


An Excel chart can appear embedded in a worksheet or reside in a separate Chart
sheet. Here's a trick for storing multiple charts on a single Chart sheet.

Create charts as usual, placing them in a worksheet. Select any blank cell in the
worksheet and press F11; this creates an empty Chart sheet to hold the embedded
charts. Reactivate your worksheet, click an embedded chart, and select Chart,
Location to display the Chart Location dialog box. Choose "As object in" and specify
the empty Chart sheet. Excel will transfer the embedded chart to your Chart sheet.

Select your remaining charts, and use Chart, Location to move them to the Chart
sheet. Now you can arrange and size the charts any way you like. Putting multiple
charts on a single Chart sheet lets you use the View, Sized with Window command
(available when the Chart sheet is active) to scale the charts to the window size and
dimensions.

Following is an example of a Chart sheet that contains three charts. When the window
is resized, the charts adjust to fill the window automatically.

Excel User Tips_Chart_and_Graphic


Page 7 of 15
Displaying a value in an AutoShape
You want to make a particular value really stand out? Use an AutoShape.

First, click the AutoShapes button on the Drawing toolbar, select the shape you want
to use by clicking it, and click in the formula bar. Then enter a cell reference such as
the following:
=$B$14
Press Enter. In the example below, the contents of cell B14 will then be displayed
inside the AutoShape. If the content of the referenced cell changes, the graphic will
reflect the change. The advantage is that AutoShapes offer formatting options that
are not available within the standard Format menus.

Excel User Tips_Chart_and_Graphic


Page 8 of 15
To make an AutoShape even snazzier, double-click the graphic to access the Format
AutoShape dialog box. From there, you can apply formatting changes -- for instance,
adjusting the vertical or horizontal positioning, changing the font, adding color, or
making the text bold.

Format cells to display in thousands


Q. Is there a way to display thousands without zeros? For example, I would
like 52,000 to appear as 52.

First, select the cells to be formatted, then choose Format, Cells. Click the Number
tab. Select Custom from the Category list, and in the Type box enter 0, (that's a zero
followed by a comma).

When this number format is applied, the cells will retain the correct numerical values,
but they will be displayed without the last three digits.

To display values in millions, insert an additional comma at the end of the format
string (0,,).

Another possibility is to display one or more decimal places--for example, 52,100 as


52.1. To do this, include a decimal point in your format string (0.0,).

You can also use these number formats in charts. To do so, double-click the chart axis
to display the Format Axis dialog box. Then click the Number tab and specify the
desired format. In Excel 2000 and later, the Scale tab of the Format Axis dialog box
lets you specify the unit scaling directly. Just choose Millions from the "Display units"
drop-down box.

Handle missing data in a line chart


When you create a line chart in Excel, missing data points (blank cells) won't be
plotted, and the line will contain gaps. Excel provides two other ways of handling
missing data:

• Treat blanks as zeros

• Interpolate the data by connecting the line between the nonmissing data
points.

The figure below shows both options. In this example, interpolating the missing data
seems the better choice in view of the data's time-based nature.

Excel User Tips_Chart_and_Graphic


Page 9 of 15
To set how Excel deals with missing data, select your chart and choose Tools, Options.
In the Options dialog box, click the Chart tab and then select the appropriate option.
Your choice will apply to all data series in the selected chart.

You can also represent data with the formula =NA() instead of leaving a cell blank.
The chart will use interpolation for data cells that contain this formula, regardless of
the setting in the Options dialog box.

Layouts for column charts


The layout of a chart can make a big difference in its legibility. Consider the two
charts shown below. Both use the same data. The top chart contains two data series,
one for each region. The bottom one uses six data series, one for each month. Which
is better? There is no correct answer. If your goal is to make month-by-month
comparisons, the top chart is a better choice. If you want to emphasize trends in each
region, the bottom chart works better.

Excel User Tips_Chart_and_Graphic


Page 10 of 15
When you create a new chart, you start by selecting the data to be plotted. Unless
you tell Excel otherwise, it makes some assumptions to determine how your data is
plotted. If the number of rows in your selected range exceeds the number of columns,
the program uses the columns for the data series (as in the top chart). If the number
of columns in your range exceeds or equals the number of rows, then Excel uses the
rows for the data series.

In Step 2 of Excel's Chart Wizard dialog box, you can specify how the data will be
plotted. Choose either Rows or Columns for the "Series in" option (you'll be able to
preview your choice). To change the way the data in an existing chart is plotted,
select the chart by clicking it, then choose Chart, Source Data. In the Source Data
dialog box, click the Data Range tab and then make your selection

Rotating Text With an AutoShape


If you use Excel's AutoShapes, you've probably discovered a limitation: If you add
text to an AutoShape, the text is not rotated when the AutoShape is rotated.

Excel User Tips_Chart_and_Graphic


Page 11 of 15
Method 1
Here's one way to circumvent that problem:

1. Create your AutoShape, add text, and format it to your liking.


2. Ctrl+Click the AutoShape to select it. Pressing Ctrl ensures that you select the
AutoShape itself, not the text inside.
3. Press Shift, and choose Edit - Copy Picture. This command is available only
when the Shift key is pressed.
4. In the Copy Picture dialog box, choose As shown on screen, and Picture.
Click OK.
5. Choose Edit - Paste
The result is a picture of the AutoShape. But, unlike the AutoShape, the text is also
rotated when the AutoShape is rotated.

The only potential problem with this technique is that you can no longer edit the text
or modify the formatting of the graphic.

Method 2
Another option is to delete the text from your AutoShape, and use WordArt for the
text. Then you can group these two objects (the WordArt and the AutoShape). After
doing so, both objects will rotated together.

Saving a chart as a GIF file


Q. How can I save a chart as a separate GIF file?

You can save your worksheet as an HTML file, and Excel will automatically convert any
charts to GIF files. If that seems like overkill, you can write a simple macro that will
do the job.

Press Alt-F11 to activate the Visual Basic editor. Select your workbook in the Projects
window, and choose Insert, Module to insert a new VBA module. Then type the
following four-line procedure into the module:
Sub SaveChartAsGIF ()
Fname = ThisWorkbook.Path & "\" & ActiveChart.Name & ".gif"
ActiveChart.Export FileName:=Fname, FilterName:="GIF"
End Sub
After the macro is entered, reactivate Excel and click the chart to be saved. Press Alt-
F8 to display the Macro dialog box. Select the SaveChartAsGIF macro and click Run.

The procedure uses the chart's name as the GIF file name, and the file is stored in the
same directory as the workbook. This simple macro does no error checking, so it will
generate an error if a chart is not selected or if the workbook has not been saved.

Excel User Tips_Chart_and_Graphic


Page 12 of 15
Unlink a chart series from its data range
Normally, an Excel chart stores data in a range. If you change the data in that range,
the chart updates automatically. Sometimes you may want to unlink the chart from its
data ranges and produce a static chart that remains unaffected by later changes in
the data. For example, suppose you plot data generated by various what-if scenarios,
and you want to save a chart that represents some baseline scenario for comparison
with others.

One way to create a static chart is to copy and paste it as a picture. Activate your
chart, hold down the Shift key, and choose Edit, Copy Picture (this option is available
only when you hold down Shift as you select Edit). The Copy Picture dialog box will
appear. Click OK to accept the defaults. Then click anywhere in your worksheet and
choose Edit, Paste.

Another way to create a static chart is to convert the range references into arrays.
Select a chart series and then click the formula bar to activate the SERIES() formula.
Press F9 to convert the range references into arrays. Repeat this for each series in the
chart. Now the chart cans till be formatted (it doesn't become a picture). The formula
bar in the figure below shows the SERIES() formula after converting the range
references to arrays.

Update charts automatically when you enter new


data
Q. I use an Excel workbook to track and chart daily sales. Since the number
of data points changes every day, I have to update the chart manually so it
includes the new data. How do I get the chart range to expand
automatically?

When you select a chart series in Excel 97 or later, the ranges used by the series are
outlined on the worksheet. You could simply drag a corner of the outline to extend the
range.

This document describes another approach that uses formulas to define the ranges
used in a chart. The steps listed below describe how to create dynamic ranges for the
chart shown in figure below.

Excel User Tips_Chart_and_Graphic


Page 13 of 15
1. Enter the data and create the chart shown in the figure.

2. Select Insert, Name, Define to bring up the Define Name dialog box.

3. In the 'Names in workbook' field, enter Date. In the 'Refers to' field, enter this
formula:

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1! $A:$A)-1)

4. Click Add to create the name. Notice that the OFFSET function refers to the
first data point (cell A2) and uses the COUNTA function to get the number of
data points in the column. Because column A has a heading in row 1, the
formula subtracts 1 from the number.

5. Now type Sales in 'Names in workbook', and in 'Refers to' enter this formula:

=OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B)-1)

6. Click Add, and then OK to close the dialog box.

7. Activate the chart and select the data series. In this example, the
(unmodified) formula in the formula bar will read:

=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$10, Sheet1!$B$2:$B$10,1)

8. Replace the range references in the SERIES formula with the names you
defined in steps 4 and 5. The SERIES formula should read:

=SERIES(,Sheet1!Date,Sheet1!Sales,1)

After performing these steps, you'll find that the chart updates automatically when
you add new data to the worksheet. .

To use this technique for your own data, make sure that the first
argument for the OFFSET function refers to the first data point, and
that the argument for COUNTA refers to the entire column of data.

Excel User Tips_Chart_and_Graphic


Page 14 of 15
Also, if the columns used for the data contain any other entries,
COUNTA will return an incorrect value.

Excel User Tips_Chart_and_Graphic


Page 15 of 15

You might also like