6
In the previous chapter, you took a comprehensive tour of Excel’s formatting fun- damentals. But of course, just because those features exist doesn’t mean they’re easy to use. Digging through your options and applying a range of formatting settings can be a tedious task. Fortunately, Excel includes a few timesavers that speed up many formatting jobs.
In this chapter, you’ll try out the essential formatting techniques that every Excel guru loves. They include:
• The Format Painter, which provides a quick-and-dirty way to transfer formatting from one cell to another.
• Styles, which let you standardize your favorite formatting choices so you can use them again and again.
• Themes, which give you a toolkit with a collection of ready-to-use styles that can jazz up the dullest worksheet.
• Conditional formatting, which gets Excel to do the hard work of finding values you’re interested in and then highlighting them with custom formatting.
Once you master these four timesavers, you’ll have the secret to making great-looking worksheets.
The Format Painter
The Format Painter is a simple yet elegant tool that lets you copy all of a cell’s format settings—including fonts, colors, background fill, borders, and even the number
Smart Formatting Tricks
sTYlEs anD
ThEMEs format—from one cell to another. (Apparently, the Excel team decided that the more accurate label “Format Copier” wasn’t nearly as exciting as the name Format Painter.) To use the Format Painter, follow these steps:
1. Move to a cell that has the formatting you want to copy.
You can use the Format Painter to copy formatting from either one cell or a whole group of cells. For example, you could copy the format from two cells that use different fill colors, and paste that format to a whole range of new cells. The new cells will alternate between the two fill colors. Although this is a powerful trick, in most cases, it’s easiest to copy the format from a single cell.
2. Choose Home→Clipboard→Format Painter to switch into “format painting”
mode.
The pointer changes so that it now includes a paintbrush icon, indicating that Excel is ready to copy the format.
3. Click the cell where you want to apply the format.
The moment you release your mouse button, Excel applies the formatting, and your pointer changes back to its normal appearance. If you want to copy the selected format to several cells at once, just drag to select a group of cells, rows, or columns, instead of clicking a single cell.
Excel doesn’t let you get too carried away with format painting—as soon as you copy the format to a new cell or selection, you exit format painting mode. If you want to copy the desired format to another cell, you must backtrack to the cell that has your format, and start over again. However, there’s a neat trick you can use if you want to repeatedly apply the same format to a bunch of cells. Instead of single-clicking the Format Painter button, double-click it. You’ll remain in format painting mode until you single-click the Format Painter button again (or press Esc) to switch it off.
NOTE The Format Painter is a good tool for quickly copying formatting, but it’s no match for another Excel feature called styles. With styles, you define a group of formatting settings, and then apply them wherever you want. Best of all, if you change the style after you create it, Excel automatically updates all the cells you formatted using that style. The next section describes styles in more detail.
Styles and Themes
Styles let you create a customized collection of format settings, give that collection a name, and save it, ready for use, as part of your spreadsheet file. You can then apply these settings anywhere you need them in your workbook. For example, you could create a style called Great Big Header that uses the Cambria font, pumps up the font size to 46 points, and colors the text bright red.
sTYlEs anD ThEMEs Every Excel spreadsheet starts off with a collection of prebuilt styles. Microsoft de-
signed them with two goals in mind: to give you quick access to the most common and practical formatting choices, and to make great-looking documents. To take a look at the styles waiting for you, choose Home→Styles→Cell Styles. Figure 6-1 shows the gallery of options you’ll see.
NOTE If your Excel window is very wide, the Home→Styles→Cell Styles button disappears, and you’ll see a scrollable gallery of styles in the Home→Styles section instead. This change saves you a click, but doesn’t alter the way styles work.
FiGuRE 6-1 Excel divides its built-in styles into categories, according to how you might use them. For example, the “Good, Bad and Neutral” category lets you separate good news (a net profit!) from bad (an $11 million tax penalty!) using carefully shaded versions of the universal colors red, yel- low, and green. The Titles and Headings category adds border formatting (page 158) to make great titles. And the Themed Cell Styles category gives you a range of differently colored, differently shaded cells that blend harmoniously with one another.
You can apply more than one style to the same cell to get just the right combination of formatting options. For example, you could use the Currency style to get the right number format, and then pick the Bad style to flag a huge debt with a light red background fill. (Bad is simply the name of a prebuilt style that applies a light red background fill and a dark red font.) If you apply more than one style and they conflict (for example, both styles use a different background color), the style you applied last takes over.
Styles use Excel’s live preview feature, which gives you try-before-you-buy format- ting. When you select a group of cells and then hover over one of the styles in the ribbon, your selected cells change instantaneously to reflect that style. Run your
sTYlEs anD
ThEMEs mouse over the different style options, and you see a quickly changing series of formatting choices. To actually apply a style, click it.
If this was all that styles offered—a handy way to reuse good-looking formatting presets—they’d be quite useful. But wait, there’s more: Excel styles come with two more invaluable features. First, you can create your own styles and reuse them time and again. Second, you can use themes to swap one set of styles for another. You’ll learn both these techniques in the following sections.
NOTE At the bottom of the style list (Figure 6-1) is the Number Format group of styles. These styles simply apply a different number format (page 128) to a cell, like Currency, Percentage, and so on. They don’t do any other formatting. However, they’re still useful. For example, you could use Currency style for all the dollar figures in your worksheet and then, at some later point, modify that style to use a different currency symbol, set a different alignment, or change the number of decimal places. This one change updates every cell that uses the Currency style—in this case, all the prices across your entire worksheet.
TIMESAVING TIP
A Quicker Way to Apply Styles
The ribbon makes it fairly easy to work with styles. However, sometimes you may be in the middle of working with another ribbon tab and find it’s just too inconvenient to jump back to the Home tab.
If you’re in this situation, you can make your life more pleasant by adding the style gallery to the Quick Access toolbar. To do so, choose Home→Styles→Cell Styles, right-click any style, and
then choose Add Gallery to Quick Access Toolbar. This adds a Cell Styles button to the toolbar, so it’s always available to you. Click the Cell Styles button and you’ll see the familiar style gallery.
If you get tired of the Cell Styles button on the Quick Access toolbar, right-click it, and then choose Remove from Quick Access Toolbar.
Custom Styles
Styles really shine in complex worksheets where you need to apply different format- ting to different groups of cells. For example, say you’ve got a worksheet that tracks your company’s fiscal performance. You’re confident that most of the data is reliable, but know that a few rows come from your notoriously hopeful sales department.
To highlight these sales projections, you decide to use a combination of a bold font with a hot pink fill. And since these figures are estimated and aren’t highly precise, you decide to use a number format without decimal places and precede the number with a tilde (~), the universal symbol for “approximately right.”
You could implement all these changes manually, but that’ll take fourscore and seven years. Better to set up a style that includes all these settings, and then apply it with a flick of your wrist whenever you need it. Styles are efficiency monsters in a few ways:
• They let you reuse your formatting easily, with just a mouse click.
• They free you from worry about being inconsistent, because the style includes all the formatting you want.
sTYlEs anD ThEMEs
• Excel automatically saves styles with your spreadsheet file, and you can transfer styles from one workbook to another.
• If you decide to change a style, you can do so with just a few mouse clicks. Then Excel automatically adjusts every cell that uses the style.
Here’s how you create a new style:
1. Begin by moving to a cell in your worksheet that has the formatting you want for your style.
The quickest way to create a new style is to start with an existing one. However, you can also create a new style from scratch. To do that, move to a blank, unformatted cell in your worksheet.
2. Select Home→Styles→Cell Styles→New Cell Style.
The Style window appears, which lets you design your own styles.
3. In the “Style name” box, type a name for your new style.
For example, if you want to create a new style for column titles, enter the style name ColumnTitle. Each style in your workbook has to have a unique name.
4. Choose the style options you want.
Styles don’t need to format every aspect of a cell. For example, you might want to create a style that applies new font and fill settings, but keeps the current Number format (page 128), alignment, and border details. When you create this style, you’d clear the Number, Alignment, and Border checkboxes, so these details aren’t included in your new style. Figure 6-2 shows an example.
FiGuRE 6-2
Here, you’re about to create a new style, named WildAndCrazySales- People. This style defines a Number format as well as font and fill settings. If you don’t want your style to include some of these settings, turn off the appropriate checkboxes. For example, if you want to create a style that applies a new font, fill, and border, but you want to keep the existing alignment and number format, turn off the Number and Alignment checkboxes. As a general rule, if you don’t need to explicitly set a specific style characteristic, turn off the corresponding checkbox.
sTYlEs anD ThEMEs
NOTE When you select many style checkboxes, you create a pumped-up style that does a lot at once.
When you select only one or two style checkboxes, you create a less powerful style, but one that’s more flexible.
You can use it in a variety of cells that already have customized formatting, without changing the formatting characteristics you want to keep.
5. Click Format to specify the formatting options for the style.
When you click Format, the familiar Format Cells window appears. Use this window to change the formatting just as if you were formatting an individual cell. Click OK to close the Format Cells window when you finish.
6. Click OK to close the Style window.
Once you’ve created a style, applying it is just a matter of a few mouse clicks.
Select the cell or cells you want to modify, choose Home→Styles→Cell Styles, and then choose your style from the list (Figure 6-3).
FiGuRE 6-3 The styles you create appear in a Custom group at the top of the list of styles. (If you haven’t created any styles, you won’t see the Custom group at all.)
sTYlEs anD ThEMEs TIMESAVING TIP
Turning Off Live Preview
Most of the time, live preview is a great way for wishy-washy spreadsheet writers to see formatting possibilities without committing. However, if you have a heavily formatted work- book, you might find the live preview feature slows you down as you’re scrolling through a lot of options. In this case, it might make sense to turn off live preview.
To do so, choose File→Options, and then pick the General section. Under the “User Interface options,” turn off the Enable Live Preview setting, and then click OK. Now you can zip around the ribbon, but you need to actually apply a formatting change (by clicking the appropriate button in the ribbon) before you see what it looks like.
Modifying Styles
Keep in mind that you can modify a cell’s formatting even after you apply a style.
But if you find yourself overriding a style fairly frequently, and always in the same way, that probably means your style isn’t quite right. Either create more than one version of the same style, each with the appropriate settings, or clear some of the style checkboxes so that your style doesn’t apply formatting settings that you commonly change:
• To modify a style, choose Home→Styles→Cell Styles, find the style you want in the gallery, right-click it, and then choose Modify. You wind up back at the familiar Style window (Figure 6-2), where you can tweak the style to your heart’s content. You can use this approach to revise your own custom styles, or to change the built-in styles that Excel adds to every workbook.
• To duplicate a style, choose Home→Styles→Cell Styles, find the style you want in the gallery, right-click it, and then choose Duplicate. The Styles window appears with the style you chose. Change the formatting as desired, choose a better name, and then click OK to add this style to the Custom category.
• To delete a style you don’t want anymore, choose Home→Styles→Cell Styles, find the style, right-click it, and then choose Delete. Excel removes the formatting from all the cells that used that style.
Transferring Styles Between Workbooks
Once you create a few useful styles, you’ll probably want to reuse them in a variety of spreadsheet files. To do that, you need to copy the style information from one workbook to another. Excel makes this fairly straightforward:
1. Open both files in Excel.
You need both the source workbook (the one that has the styles you want to copy) and the destination workbook (the one where you want to copy the styles).
sTYlEs anD
ThEMEs 2. Go to the destination workbook.
3. Choose Home→Styles→Cell Styles→Merge Styles.
The Merge Styles window appears with a list of all the files you currently have open in Excel.
4. Select the file that has the styles you want to copy into your active work- book, and then click OK.
If two or more styles have the same name, Excel displays a warning message, informing you that it will overwrite the current styles with the styles you’re importing. Click OK to continue.
You can now use the styles you imported. They’re independent copies of the styles in the source workbook. If you change the styles in one workbook, you won’t affect the styles in the other, unless you merge the changed styles back into it.
TIP To automatically include custom styles in new workbooks, consider creating a template that includes those styles. Chapter 16 has the full story.
Themes: A Package of Styles
As nice as Excel’s prebuilt styles are, they don’t suit everyone. For example, the standard style colors favor subdued shades of blue, orange, and gray, which make sense for the company accountant but aren’t the most exciting choice for an urban hipster. To jazz things up, you can choose a different theme that features livelier colors. When you do, your entire worksheet gets an immediate facelift—you don’t need to track down each individual cell and reformat it.
Technically, a theme is a combination of three ingredients:
• Fonts. Every theme has one font that’s used for headings and another one that’s used for everything else. These two fonts might be different sizes of the same typeface, or two complementary typefaces.
• Colors. Every theme has a palette of 12 complementary colors. The cell styles that appear under the Themed Cell Styles heading (see Figure 6-1) draw upon these colors for text and background fills. Best of all, these colors don’t reflect the preferences of Cheeto-munching programmers. Instead, bona-fide artsy types chose them—in this case, professional designers on the Microsoft payroll.
• Effects. Effects are fine alterations that pretty up shapes and other hand-drawn graphics you can create with Excel’s drawing tools (Chapter 19). If you don’t have any shapes on your worksheet, the effect settings don’t do anything.
To choose a theme, choose Page Layout→Themes→Themes to see a gallery of choices (Figure 6-4).
sTYlEs anD ThEMEs
FiGuRE 6-4 Every workbook begins using the crowd-pleasing Office theme, but you have a long list of other options. As you hover over a new theme, your workbook adjusts itself automatically, thanks to the magic of Excel’s live preview feature.
The secret to understanding themes is realizing how changing a theme affects your worksheet. In other words, how does Excel apply a theme’s fonts, colors, and effects to your worksheet? The following sections break it down.
FONTS
Every workbook has a standard body font that it uses in every cell, which comes from the Normal style. Excel uses this standard font unless you explicitly choose a different one using the ribbon’s Home→Font section or the Format Cells window.
In a brand-new Excel spreadsheet, everything you type starts out in easy-on-the- eyes 11-point Calibri font. If you apply a new theme, you get a new Normal style and a new standard font. For example, switch to the traditionally styled Organic theme, and you’ll get the elegant Garamond font instead.
NOTE All the fonts used in Excel themes are installed as part of Microsoft Office.
sTYlEs anD
ThEMEs The same sort of magic works with the heading font, but it’s more limited—in fact, the only style that uses the heading font is Title. If you use the Title cell style and switch from one theme to another, Excel updates your cell to use the heading font from that style. In Excel’s prebuilt themes, the heading font is the same as the stan- dard body font. However, this isn’t necessarily the case if you pick a different set of fonts or create a custom theme (page 177).
NOTE You might assume that the heading styles (Heading 1, Heading 2, Heading 3, and so on) use the heading font. Oddly enough, that’s not how it works. All the heading styles use the theme’s body font. Title is the only style that uses the heading font.
If you’re feeling a bit reckless, you can override the font that Excel automatically uses for all new workbooks. To do so, select File→Options, and then choose the General section. Under the “When creating new workbooks” heading is a “Use this font” and a “Font size” setting where you can set the standard font and font size.
Ordinarily, the automatic font isn’t set to a specific font at all—instead, it’s set to the special value Body Font. This tells Excel to apply the standard font from the current theme. Usually, this is the choice you want, because it lets you quickly adapt your entire spreadsheet to a theme of your choosing.
COLORS
Every theme relies on 12 key colors. When you move from one theme to another, Excel swaps in the new set of colors. However, Excel doesn’t alter any other, non- theme colors you may have used in your worksheet.
NOTE Although each theme has only 12 base colors, Excel varies the saturation of the color to make it bolder or lighter, based on the style you use. For example, the Office theme includes a steel blue color that you can use at full strength (with the style named Accent 1) or lighten to a faint gray-blue mist (with the style named 20% - Accent1).
To make this system a bit clearer, imagine that a designer runs amok, formatting cells with different background fills. He fills some of the cells with theme colors, and others with custom colors. (Figure 6-5 shows the difference.) When you switch themes, Excel changes the cells that use theme colors, and leaves all the other cells unchanged.