Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Reading 1.

Styles
Of all formatting options Excel offers, “Styles” are probably the least popular. A style is
simply a set of formatting settings with a name. All cells to which a style has been applied
share the same formatting and when you modify a style, all cells formatted with that style
change their format accordingly.

Use of styles takes some getting used to, but can help you immensely. Imagine showing
your nicely formatted sheet to your boss. Then your boss asks you if you could please
change all input cells to having a light-yellow background fill, instead of a dark yellow one.
For a large model, this would result in a huge amount of work. If you had used styles, then it
would take just a few seconds.

Section Description Quick Tip

Creating a style Learn through a practical walk- Styles can also decide which
through how to create/set up a cells are locked/unlocked (super
style. helpful for data entry sheets).

Deviate from a style This section walks you through Deviating from styles is not hard
creating deviations from a preset and other features of a style will
style and the effect thereof. still be updated even if you
change an aspect (like color).

Tips for using styles Here you learn some super Create an extra worksheet with
practical tips for setting up and all the styles to easily update
maintaining styles. formats across your whole sheet
in mere moments.

How styles work


Styles are in fact an addition. Cell formatting is the sum of the applied style and all
modifications to individual formatting elements on top of that style. What parts of the
formatting options are included in a style is determined during the definition of the style (See
screenshot below).

READING 1.7 | STYLES | PAGE 1 OF 8


1.7.1 Creating a style
An easy way to create a style is by formatting a cell precisely the way you want it to look and
behave. All elements of the Format Cells dialog may be set up as a part of the style. For this
example, we’ve selected cell B3, chosen the Input style and subsequently unchecked the
Locked property:

To create a new style with this changed setting, select the Home tab and click the Cell Styles
drop-down.

Choose “New Cell Style”:

READING 1.7 | STYLES | PAGE 2 OF 8


The Style dialog opens:

To create a new style, simply type its name in the box "Style name". By default, all formatting
elements are checked. Remove the checkmarks for the formatting elements you want to
omit from the style you are creating (the dialog shown above has the Number and Alignment
elements turned off).

Use the "Format..." button to adjust the elements to your needs. Excel will show the standard
"Format cells " dialog screen:

READING 1.7 | STYLES | PAGE 3 OF 8


The elements in the Style dialog are identical to the tabs on the Format Cells dialog.
Note: As soon as you change a formatting element on a tab that was not selected on the
Style dialog, Excel will automatically check that element for you; it will become part of the
style.

As soon as you close the new Style dialog, the newly added style is not applied to your cell,
you’ll have to do that after the style has been added.

Applying styles
It is very easy to apply a style to a cell. Just click the Home tab, and from the Styles group
expand the Cell Styles gallery and click a style.

Any formatting elements the cell already has which are in the categories checked in the style
definition will be overwritten by the ones form the styles. The categories which are not
checked will remain untouched.

1.7.2 Deviate from a style


If you have applied a style to a set of cells and you manually change a formatting element of
one of those cells, then modifications to that particular element of the style will no longer be
applied to the modified cell.

So after changing a fill attribute (like the color) of a cell, changing the fill color of the style
will update all cells, except the one you just modified. First we selected one cell (B7) and
changed its fill color:

READING 1.7 | STYLES | PAGE 4 OF 8


After that, we right-clicked the New Style in the Styles drop-down gallery and chose “Modify”:

and modified the fill color of the style to red:

Pressing OK twice yields:

READING 1.7 | STYLES | PAGE 5 OF 8


As you can see, cell B7 no longer updates the fill color as that part of the cell style in cell B7
has become unchecked. To fix this behavior, simply select cell B7 and apply the cell style
again. Any formatting part of the style will overwrite the current formatting of the cell.

1.7.3 Tips for using styles

Managing styles
If you like to keep an overview of what styles are available in your file we would advise you to
add a special worksheet to your workbook. Put the names of the styles in column A and an
example output in column B:

If you need to adjust a style, select the cell in column B and adjust the style settings from
there.

READING 1.7 | STYLES | PAGE 6 OF 8


Creating a new style based on an existing one is easy now: Just copy the applicable row and
insert it anywhere in the table. Select the cell in column B of the newly inserted row and
choose Home tab, Style dropdown, New Cell Style. Enter the name of the new style and click
Add. Then click Modify to change the style details. Don't forget to update the name in
column A too.

Use styles vigorously


I advise you to use styles as strictly as you can. Try to avoid modifying one element of a cell.
Instead, consider if it is worth the effort to add a new style. If for instance you have a style
for percentage with 2 decimal places and you have a cell which requires three, then add a
style for that purpose.

Adopting this method will likely trigger you to think about what cell styles your document will
need. By doing this the quality of your Excel model will gradually improve. You'll gain in
consistency and lose the ad-hoc (often messy) formatting jungle that you may have grown
accustomed to.

Use functional sets of styles


By looking at your Excel model you will likely be able to categorize your workbook cells into
various categories:

• Input cells: Cells that are the main input to your model
• Parameter cells: Cells that contain constants for your model, such as boundaries.
• Output cells: Cells in an area that is meant for output, such as printing or presenting
the results of a calculation on screen.
• Calculation cells: The cells where the actual calculation work is performed
• Boundary cells: By shading otherwise empty cells you can easily make areas with
differing functions stand out from other areas.

Consider creating separate (sets of) styles for each of these cell functions, each (e.g.)
having its own fill color. Don't forget to make decisions on whether or not a style's locked
property needs to be on or off. If you use a system like this, it becomes very easy for you to
maintain your file. Imagine how easy it now becomes to change a cell from an input to an
output cell: you change the style and you’re done.

READING 1.7 | STYLES | PAGE 7 OF 8


Naming styles
It is a good idea to develop a simple naming convention for your styles. For example:

• Input_Num2DP • Calc_Num2DP
• Input_Date • Calc_Date
• Input_Time • Calc_Time
• Input_Text • Calc_Text

That way styles with a similar function will remain together on the Styles gallery (the styles
are sorted alphabetically by their names) whereas you can quickly discern between similar
styles by what’s in their names.

READING 1.7 | STYLES | PAGE 8 OF 8

You might also like