Excel 2013 Cell Formats, Styles (Level3)
Excel 2013 Cell Formats, Styles (Level3)
Contents
Introduction ..............................................................................................................1
Formatting a Cell .....................................................................................................2
Formatting Text .......................................................................................2
Formatting Numbers .............................................................................2
Numeric Text ............................................................................................4
Formatting Cells ......................................................................................4
Advanced Formatting ............................................................................6
The Number Tab ......................................................................................6
The Alignment Tab .................................................................................6
The Font Tab ..............................................................................................6
The Border Tab .........................................................................................6
The Fill Tab .................................................................................................7
The Protection Tab .................................................................................7
Built-in Styles ............................................................................................................7
Customising a Style .................................................................................................8
Creating a Style .........................................................................................................9
Conditional Formatting .........................................................................................9
Introduction
In the same way that a paragraph or piece of text uses a format to specify its appearance in
Microsoft Word, a format can be applied to a cell or its contents in Microsoft Excel. Not only are
there the usual font, font size/colour, bold/italic/underline and justification settings found in
Word but also less commonly-used aspects such as background colour, borders and text
orientation. In addition Excel allows you to format a number (eg how many decimal places) or
date/time (eg to display the month as August or Aug or /08/). By applying a format you do not
alter the contents of the cell in any way - just how it is displayed.
Where a particular cell format is to be used on a regular basis, it can be stored as a style - just
like the styles in Word such as Heading 1 or Normal. Excel already has a few built-in styles, such as
Percent and Accounting but you can also define your own.
Formatting a Cell
You should be familiar with the regular formatting buttons in the Font and Alignment groups on the HOME
tab - ie [Font], [Font Size], [Bold], [Italic], [Underline], [Borders], [Fill Color], [Font Color], [Align Text Left],
[Center] and [Align Text Right]. Excel has further buttons in these groups, as you’ll see in the following
exercises, and yet more in the Numbers group, which are specifically for formatting numbers.
Formatting Text
Text can be formatted in Excel in much the same way as in Word:
1. Start with a new workbook (press <Ctrl n> for a new file) or move to an empty worksheet
2. Type Formatting Text in cell A1 then press <Ctrl Enter> to enter the text and remain in A1
3. Try out the [Font], [Font Size], [Bold], [Italic] and [Underline] buttons in the Font group
You'll find they act just as they do in Microsoft Word but on the whole contents of the cell. To apply a format
to just part of the text:
4. Drag through the word(s) to be formatted on the Formula Bar - eg select the word Text
5. Click on the required format button(s)
6. Press <Enter> to see the result and move to cell A2
You can also apply the required formatting as you type the text:
7. In A2 type Circumference=2 then click on the [Font] list arrow and choose Symbol
8. Type the letter p then click on the [Font] list arrow again and choose Calibri (note that π only shows
as such in the cell, not on the Formula Bar)
9. End by typing the letter r then press <Enter>
Tip: When entering text into a cell, use <Ctrl b>, <Ctrl i> etc to apply or turn off bold/italic/etc as you type.
For super/sub-script:
10. In cell A3 type Area= then change the [Font] to Symbol, type a p
11. Change the [Font] back to Calibri and type r
12. Next, click on the Font group arrow ( or press <Ctrl Shift F>) to display the Format Cells dialog box
13. Under Effects turn on Superscript - press <Enter> for [OK]
14. Type 2 then press <Enter> to finish typing
Note that certain characters can also be typed in by using <Alt> and the Numeric Keypad - superscript 2 is
<Alt 0178>, for example.
Tips: Another way to get text with special characters into Excel is to type it in Word then Copy and Paste it
across. You can also make use of AutoCorrect Options… (in the Proofing set under Options from the FILE
tab) to set up abbreviations for text - any entries here are available throughout Microsoft Office.
Formatting Numbers
As well as the normal formatting available for text, Excel provides special formatting for numbers. Whenever
such data is typed into a cell, Excel automatically tries to give it an appropriate format. It's important to
understand these formats and to know how to clear or change them, if necessary.
1. Move down to cell A5
2. Type Formatting Numbers in the cell then press <Enter> to move to A6
3. Type the number 1234.56 then press <Ctrl Enter> to remain in A6
2
4. Click on the [Accounting] style button on the left of the Number group - a pound sign and comma
(thousands) separator appears
5. Now try out the next four buttons: [Percent Style], [Comma Style], [Increase Decimal] and
[Decrease Decimal] – there’s also the [Number Format] button above these with further formats
6. Click on [Decrease Decimal] again and note how the data is rounded to the nearest value
To clear a format:
7. Click on the [Clear] button in the Editing group on the right and choose Clear Formats
Note: Cell formatting can also be applied using the following key combinations:
< Ctrl !> - Apply Number format with 2 decimal places < Ctrl $> - Apply Currency format
<Ctrl %> - Apply Percentage format <Ctrl ^> - Apply Exponential Number format
<Ctrl #> - Apply Date format <Ctrl @> - Apply Time format
< Ctrl ~> - Apply General Number format (this can be used to clear any of the above)
It is all too easy to impose a format on a cell by accident:
1. Press <Enter> to move to cell A7
2. Type £5 into the cell then press <Ctrl Enter> to remain in A7
3. Try typing other numbers into cell A7, including some which are not whole numbers - all are shown as
a currency (even though you aren't typing the pound sign) and rounded to the nearest whole number
A format may also be automatically copied to another cell in a calculation:
4. Move to cell A8 and type in the formula =a7/10 and press <Ctrl Enter>
Again, the answer is shown as pounds!
Automatic formatting can give very peculiar results - you need to understand what's happening:
5. Use <up arrow> to move back to cell A7
6. Type 5-2 and press <Ctrl Enter>
Excel interprets this as a date (5th February in the current year, as displayed on the Formula Bar) - you forgot
the equals sign if you wanted to calculate 5 minus 2. Dates are stored as numbers (in fact the number of days
since the start of the year 1900). In cell A8 this value has been divided by 10, but the cell has retained its
original format - hence the result of £4204 (in 2015). Now, whenever you try to type a number into cell A7
you will find it will be converted into a date. To see this:
7. Still in cell A7, type in a number - press <Enter>
8. If ########## is displayed, the number you entered is too large or negative – try again
To clear the unwanted formats from both the cells:
9. Drag through cells A7 and A8 to select them then click on [Clear] and choose Clear Formats
Tip: Another way to clear an unwanted format is to use format painting - move to a cell which hasn't been
formatted, click on the [Format Painter] button then on the cell with the rogue format.
Another useful numeric format is Fraction. This doesn’t have its own button on the Ribbon but is accessed
either via the [Number Format] button or by typing in the data in a special way:
1. Move to cell A9
2. Type 0 1/2 (there must be a space between the 0 and the fraction) then press <Enter>
3. In cell A10 type =a9*a9 – press <Enter>
4. In cell A11 type =a10*a10 – press <Ctrl Enter>
The answer appears as 0! This is because the current fraction format is set for 1 digit. To solve this:
5. Click on the [Number Format] button and choose More Number Formats…
6. Choose Up to two digits (21/25) then press <Enter> for [OK]
3
Numeric Text
One numeric format which Excel doesn't allow is leading zeros. This makes it difficult, for example, to store
telephone numbers with their full dialling codes. The answer is to store the number as numeric text. To do
this, you either fix the cell format as text (see later) or precede the number with a single quote:
1. Move down to cell A13 and type Numeric Text - press <Enter>
2. In cell A14, type in 0118 then press <Enter> - you’ll find the leading 0 disappears
3. Repeat step 2 but precede the number with a single quote (between the <L> and <Enter> keys)
You will find the leading zero is displayed (but not the quote) and it appears on the left of the cell
4. Try applying a numeric style (eg [Percentage]) - you will find the numeric text doesn't change
Because the number is stored as text, numeric styles do not apply. If you were to type in a number without
the leading single quote, then they would. Using a single quote to insert text in this way is useful for other
characters too. For example:
showing equations with a leading equals sign
showing numeric text which include dashes and/or slashes (otherwise interpreted as dates)
Showing numeric text which includes a colon (otherwise interpreted as a time)
showing a leading plus sign
where you have a numeric heading (eg year date) which mustn't be included in calculations
This last example can be very important. Try summing up the values in cells A14 and A15:
5. Move down to cell A16 and press <Alt => (or click on the [AutoSum] button on the HOME tab)
6. Press <Enter> to accept the range A14:A15
Note that the answer doesn't include A15!
7. Move up to A15 and type 0118 (missing out the quote) then press <Ctrl Enter> - as before, the
leading zero is lost and the number is included in the sum (the cell only had a temporary Text format)
8. Now click on the [Number Format] button and choose Text – the number moves to the left but the
sum doesn’t change
This is very confusing as you would expect the data to be stored as numeric text. Only when data is entered
into a cell after it has been formatted as text format has been is this particular format applied!
9. Type in the information again (or press <F2> for edit mode then <Enter>) and it will be stored as
numeric text – the sum no longer includes it (the cell now has a permanent Text format, until cleared
Formatting Cells
So far you have seen how the contents of a cell can be formatted. In this next section you will format the cell
itself. The buttons provided on the Ribbon let you set the justification, fill and font colour, cell border and
text orientation. You will explore further formatting options in the section following this one.
1. Move down to cell B18 and type Formatting Cells then press <Ctrl Enter> to stay in the cell
2. Click on the list arrow attached to the [Font Color] button and select a different colour – note how the
colours change as the mouse passes over them (like they do in Word)
3. Next, click on the list arrow attached to the [Fill Color] button and select a different colour – again, the
cell background changes colour as you move the mouse over them
Note how only cell A1 is coloured - you are formatting just this cell, even though the contents spill into the
cell to the right.
4. Click on the list arrow attached to the [Borders] button and select a Thick Box Border then press
<Enter> to move to B19
4
Again, note how the border isn't drawn on the right. This is because it would interfere with the text spilling
into B1. To cure this and the fill colour you need to merge the cells (or widen the column):
5. Drag through cells B19 and C19 to select them then click on [Merge & Center] (to the left of
[Currency]) – the Fill Color is now correct but only the left border is retained
6. Repeat step 4 to create a border around the merged cells
[Merge and Center] is more frequently used to centre headings across sets of data - eg to place a year date
over 12 columns showing the months. If you don't want the heading centred, simply rejustify it:
7. Click on the [Align Text Left] button
One disadvantage of merged cells is that some of the usual Excel commands no longer work properly. Here
are a few examples:
8. Select column B by clicking on the column heading letter and then [Cut] it - an error message appears
9. Try [Copy] instead then click in cell E1 and press <Enter> for [Paste] - the merged cell isn't copied
10. Select column B again and change the [Fill Color], choosing a different one from cell B19 - only cells
above and below B19 are coloured
11. Click on [Clear] and choose Clear Formats (the error message again appears)
12. Select both columns B and C then repeat step 10 – this time it works (as would Cut/Copy/Clear)
13. Press <Ctrl z> twice to [Undo] the new fill colour
To remove the merging:
14. Click on cell B19 then on the [Merge & Center] button again - cell C19 reappears but retains the fill
colour and border settings of the merged cell
15. Finally, double click on the border between column headings B and C to autofit the column width to the
text in that column (ie in B19) – it would have been much easier to do this in the first place!
The other buttons in the Alignment group let you justify the text vertically, display it at an angle or change the
indentation. Begin by increasing the height of the top row:
1. Press <Ctrl Home> to move to cell A1
2. Move the mouse cursor on to the border between row 1 and row 2, hold down the mouse button and
increase the row height to about 50 pixels
3. Double click on the border between column headings A and B to autofit the column width
4. By default, text is positioned at the bottom of the cell – click on the [Top Align] button to move it up
5. Next try [Middle Align] then [Center] – the text is now centred both horizontally and vertically
Now test out the orientation settings:
6. Click on the [Orientation] button and choose Angle Counterclockwise
You’ll find that not all the text appears – that’s because Excel has imposed a fixed row height
7. Click on the [Format] button in the Cells group and choose AutoFit Row Height
8. Now try out some of the other options available via the [Orientation] button – the row height
changes automatically
9. Choose the same Orientation twice to return the text to normal
10. Move the cursor to the border between column headings A and B and reduce the width to 80 pixels
11. Now click on [Wrap Text] in the Alignment group – the words appear on several lines
To view or change the current settings:
12. Click on the [Orientation] button and choose Format Cell Alignment – the Format Cells dialog box
appears
13. Note how you can specify the settings precisely, but here, press <Esc> for [Cancel]
5
Advanced Formatting
So far you have used the buttons on the Ribbon to set the cell format. In this next section you will look at
some of the other settings available via the Format Cells dialog box.
1. Move to cell B2 then click on the Number group arrow - the Format Cells dialog box is displayed
Note: You can display the dialog box by clicking on any of the Font, Alignment or Number group arrows or via
Formal Cell Alignment from [Orientation] as you saw above.
Built-in Styles
Excel has a range of built-in styles, accessible from the [Cell Styles] button:
1. Click on the [Cell Styles] button in the Styles group on the HOME tab – the following appears:
7
A range of colour combinations (font and fill colour) is provided on these buttons with styles called Good,
Bad, Input, Warning Text and Title, for example.
2. Move the mouse over the styles and note their effect on the current cell
3. Select an appropriate style for the current cell by clicking on one of the styles
There are also some additional number formats here, which automatically give you whole numbers:
4. Move to cell B7 and type in 5.65 then press <Ctrl Enter>
5. Click on the [Cell Styles] button and choose Currency (0)
This gives you an accounting format with 0 decimal places - the [Accounting] button gave you 2. In the
sections which follow you will customise an existing style and create your own style from scratch.
Customising a Style
Excel lets you customise an existing style:
1. Click on the [Cell Styles] button to open the selection then right click on Currency (0) and choose
Modify… – the Style dialog box appears:
8
repeated several times to cover what happens with negative numbers (eg are they shown in red), each
pattern being separated by a semi-colon.
11. In the Type: box, click immediately before the first semi-colon - move the insertion point using the
<arrow keys> if necessary
12. Type "cents" - the double quotes are needed to insert text
13. Press <Enter> for [OK] twice to close the dialog boxes
The new format isn’t applied yet – to do so:
14. Click on the [Cell Styles] button and select Eurocents at the top of the selection
You should now have both the Euro sign and cents added to the display.
Note: you didn't change the settings for negative numbers. If you were to type a negative value into the cell,
the word cents would not be shown. You can add this to the end of your format code, if you like.
Creating a Style
You saw in the above example how you could create a new style based on an existing one. In this next
exercise you’ll create your own from scratch. Creating a style works just the same as it does in Microsoft
Word. The easiest way to do this is to format a cell with all the features you require and then save those
settings as a style:
1. Move to cell B8 and type in €5.65 (to get the Euro sign, hold down the <Alt Gr> key to the right of
the <spacebar> and press <4> - note that <Alt Gr> is equivalent to <Ctrl Alt>) – press <Ctrl Enter>
2. Change the [Font Size], [Font Color] and [Fill Color] and make the numbers [Bold] and [Center] them
3. Now, click on the [Cell Styles] button and choose New Cell Style… at the bottom of the selection
4. Type the name for the new style (eg My Euro) and press <Enter>
You now have you own Euro style, which you could apply to other cells, as required.
If you decide you would like to modify a customised style, you’ll find that you have to set up everything again
from scratch.
Conditional Formatting
One very useful formatting option available in Excel is to be able to choose different formats depending on
the contents of the cell. In this next exercise you’ll be using the example file used in the Intermediate course
(you can also download the file by clicking on the hyperlink in step 3):
1. Press <Ctrl o> for [Open] then click on [Browse] followed by My Computer
2. Next, double click on Data (D:) then [Open] the folder called Training
3. Click on phoenix.xlsx - press <Enter> for [Open]
Start with the built-in conditional formats (which can simply colour the cells or attach icons to them)
1. Click on the column heading letter B to select column B
2. Click on the [Conditional Formatting] button and choose Highlight Cell Rules then Greater Than…
3. Type a value in the box provided (eg 6000) and change the format colour, if you like – press <Enter>
4. Repeat steps 1 to 3 but this time choose Less Than… and set a different colour
Note that the whole column is now coloured in! In the above exercise, you entered an arbitrary value to
colour code the cells. It would be better to use the average:
9
5. First, select just the cells with numeric data – click on cell B2 then hold down <Shift> and <Ctrl> and
press <down_arrow> - you should have B2 to B51 selected
6. Click on the [Conditional Formatting] button and choose Top/Bottom Rules then Above Average…
7. Change the format colour, if you want, then press <Enter> for [OK]
Next, try some scales and icons:
8. Select column C this time (by clicking on the column letter)
9. Click on the [Conditional Formatting] button and choose Colour Scales
10. Move the mouse over the predefined scales and select the one you like
11. Next, repeat steps 8 to 10 on column D but this time choose Icon Sets
As you can see, there are a host of options to choose from and you can customise these further using the
More Rules… option. In fact this next exercise will show you how these work.
The final exercise in these notes is to colour the cells in column F according to the Colour specified in each
cell.
1. Move to cell F2 then click on [Conditional Formatting] and choose Manage Rules… – a dialog box
appears:
Currently, you have no rules but you can now set some:
2. Click on the [New Rule…] button – another dialog box appears
3. Change Select a Rule Type to Format cells that only contain – the dialog box changes:
4. Using the list arrows etc, set the condition to read Cell Value equal to Red-Brown
5. Now click on the [Format...] button
6. Click on the Fill tab and choose a colour (eg the first of the Standard colours at the bottom)
7. Press <Enter> or click on [OK] twice to set up the first condition
8. Repeat steps 2 to 7 but set the condition to read Cell Value equal to Blue-Green and choose
a blue-green colour from the palette provided
9. Click on [OK] again to set up the conditional formatting
Finally, you need to copy the conditional format to the other cells in the column:
10
10. Click on the [Format Painter] button on the left of the HOME tab
11. Click on the column heading letter F to paint the format to the whole column (you could also have
selected the whole column before setting up the rules)
12. End by closing down Excel – there’s no need to save the files unless you would like to