ExcelFunctions.net Logo

Excel Formatting

Home » Basic-Excel » Excel-Formatting


Search this site:
Custom Search

The use of Excel formatting can give your spreadsheet a professional look and can provide essential information about your data to the user of your spreadsheet.

However, when using Excel functions, it is important to fully understand Excel formatting, because the way you see data in an Excel spreadsheet, is not necessarily the way Excel 'sees' the data.

For example, in Excel, dates and times are stored as numbers, but when they are displayed in the cells of a spreadsheet, they have generally been formatted to look like dates.

Similarly, if you see a currency amount of $1,500.00 displayed in an Excel spreadsheet, this is generally stored in Excel as the number "1500". It is only the formatting of the cells that displays this number with the currency sign ($), the thousands separating comma, and the decimal places.


Accessing the Cell Formatting Options

There are several ways to access the Excel formatting options for a spreadsheet cell or range of cells. For all methods, click on the cell (or range) and then either:

  • Use the Format Cells control box, which is accessed by any of the following 3 methods:

    • right-click on the selected cell or range and select the Format Cells ... option from the drop-down menu

    • Press CTRL-1 (ie. Select the CONTROL key and while this is depressed, select the "1" (one) key)

    • In Excel 2003: Select the Format menu from the top of the spreadsheet and then select the Cells option

      OR

    • In Excel 2007: Press CTRL-SHIFT-F (ie. Select the CONTROL key and while this is depressed, select SHIFT and "F")

  • Use the buttons on the 'Format' toolbar. These are available for some Excel formatting options, such as text colour, background colour, applying Bold, Italics or Underlining to cell contents, or horizontal alignment of cell contents. However, this toolbar does not include all Excel formatting options.

Excel Data Types

Excel recognises the value of a cell as one of the following types:

  • text
  • a logical value
  • a number

Text values will always have the same appearance inside a cell, because Excel recognises them as pure text, with no meaning. Logical values are displayed as TRUE or FALSE

Numbers, however, can be displayed in many different ways in an Excel Cell. For example, a value that is stored as a number within Excel may be represented as a date, a percentage, a currency, etc.

Although it appears to the user that there are several different types of data in your spreadsheet, it is only the Excel formatting of your number, that makes this single data type appear to have different attributes.

The spreadsheet below gives examples of different ways of formatting Excel cells containing numerical values.

  A B C
1   Formatted Value Underlying Value
2 A number formatted as a percentage: 59% 0.59
3 A number formatted as currency: $54.27 54.27
4 A number formatted as a date: 01/08/08 39455
5 A number formatted as a time: 12:27 PM 0.51875
6 A number formatted as a fraction 1 3/4 1.75


Format Cells Control Box Number Type

Changing Cell Formatting

To change the Excel formatting of a cell's contents, enter the Format Cells control box, (using any of the 3 methods described above), and ensure the first tab, Number is selected.

From within the Number tab, select the Excel formatting Category that you want to apply to your cell. For most of the categories, this will cause further options to appear on the right hand side of the control box, which you can then select from.

Note that the listed Excel formatting types will only work with numbers, so if you apply a date format to a cell containing text, the appearance of the cell will remain unchanged.



Tip:

Do you have problems identifying whether the contents of a cell are stored as text or as a number by Excel?

If you set the horizontal alignment of your cells to "General", Excel aligns numerical values to the right of the cell and text to the left of the cell. This enables you to tell, at a glance, the underlying datatype of a cell's contents.

Set the horizontal alignment using the options in the Alignment tab of the Format Cells control box.



Format Cells Control Box

Define Your Own Formatting Style

Within the Number tab of the Format Cells control box, you will notice the last formatting category is Custom. This option has a number of Excel formatting styles that you can select and either use as they are, or edit to produce your own formatting style.

To define your own formatting style select the Custom category and then, select one of the types from the menu on the right of the control box. The formatting definition of the selected type then appears in the 'Type' box, which you can then edit.

The following sections discuss each of the different Excel formatting options that can be used for displaying numbers:



Integer, Decimal & Currency Formatting

Formatting a number as an integer or decimal uses the following characters:

0 - Forces the display of a digit in its place
# - Display digit if it adds to the accuracy of the number (but don't display if a leading zero or a zero at the end of a decimal)
. - Defines the position that the decimal place takes
[colour] - The name of a colour can be inserted between square brackets to define the font colour

Other characters, such as the ",", "$", "£", "+", "-", "(" and ")" can be displayed at the start, middle and/or end of numbers, to make the number more readable, denote currency, or denote positive or negative values, etc. You can even replace the number completely with your chosen characters (eg. replacing a zero value with the text "NIL")

You can define one, two or three basic Excel formats for any one cell. If the cell contains a number, these formats are applied depending on whether the number is positive, negative or zero, as follows:

  • If a single text format is supplied, this format is applied to all numbers;
  • If two text formats are supplied, and separated by a semi-colon, the first format is applied to positive numbers (and zeros) and the second format is applied to negative numbers
  • If three text formats are supplied, separated by semi-colons, the first format is applied to positive numbers, the second format is applied to negative numbers and the third format is applied to zero values.

Examples

The following examples show the effect of different Excel formatting definitions on the numbers 5198.34, -98.66667 and 0

Formatting Definition: Resulting Format of Number:
5198.34 -98.66667 0
0000.0000 5198.3400 -0098.6667 0000.0000
0.0## 5198.34 -98.667 0.000
+#,##0.00;-#,##0.00 +5,198.34 -98.67 +0.00
+#,##0.0#; (#,##0.0#); "NIL" +5,198.34 (98.67) NIL
[Blue]+0.0; [Red] (0.0#); [Green] "NIL" +5198.3 (98.67) NIL
$#,##0.00 $5,198.34 -$98.67 $0.00


Formatting Percentages

The formatting of percentages in Excel uses the "0", "#" and "." characters in the same way as the formatting of integers and decimals. However, when using the percentage format, Excel displays the number multiplied by 100 and followed by the % sign.

Examples

Some examples of the numbers 0.55555, -0.5 and 0, formatted as percentages are shown below:

Formatting Definition: Resulting Format of Number:
0.55555 -0.5 0
0.00% 55.56% -50.00% 0.00%
0.0##% 55.555% -50.0% 0.0%
[Blue]+0.0%; [Red] -0.0%; [Green] 0.0% +55.6% -50.0% 0.0%


Date & Time Formatting

When formatting a cell as a date, time or date and time, use the following characters:

d -
Day of the month or day of week
d = one or two digit representation (eg. 1, 12)
dd = 2 digit representation (eg. 01, 12)
ddd = abbreviated day of week (eg. Mon, Tue)
dddd = full name of day of week (eg. Monday, Tuesday)
m -
Month (when used as part of a date)
m = one or two digit representation (eg. 1, 12)
mm = two digit representation (eg. 01, 12)
mmm = abbreviated month name (eg. Jan, Dec)
mmmm = full name of month (eg. January, December)
y -
Year
yy = 2-digit representation of year(eg. 99, 08)
yyyy = 4-digit representation of year(eg. 1999, 2008)
h -
Hour
h = one or two digit representation (eg. 1, 20)
h = two digit representation (eg. 01, 20)
m -
Minute (when used as a part of a time)
m = one or two digit representation (eg. 1, 55)
m = two digit representation (eg. 01, 55)
s -
Second
s = one or two digit representation (eg. 1, 45)
ss = two digit representation (eg. 01, 45)
AM/PM - Indicates that a time should be represented using a 12-hour clock, followed by "AM" or "PM"

Examples

The example below shows different Excel formatting definitions for the date and time '06:00AM on 25th August 2008':

Formatting Definition: Resulting Format of Date / Time:
dd/mm/yy 25/08/08
d/m/yyyy 25/8/2008
ddd dd mmmm yy Mon 25 August 08
dd/mm/yyyy hh:mm:ss 25/08/2008 06:00:00
hh:mm:ss 06:00:00
dddd dd mmm yyyy hh:ss:mm AM/PM Monday 25 Aug 2008 06:00:00 AM


Other Types of Excel Formatting

The Format Cells control box, contains a number of other cell formatting options, allowing you to define the alignment of cell contents, the size, style & colour of text, the cell borders and the colour and pattern of the cell background. These formatting options are self-explanatory and are best learned by experimentation.

Some Excel formatting options of particular use are described below:

Wrap Text

  A B C
1 This cell has the Wrap Text option unselected
2 The wrap text option is
selected for this cell
   

This option is controlled by a tick-box in the Alignment tab of the Format Cells control box. When ticked, this option forces the contents of the selected cells to 'wrap around', instead of being hidden or writing over adjacent cells. This is shown in the example spreadsheet below:



Tip:

If you want to force a line break at a specific point in a cell, go into the cell (ie. double click on the cell or select the cell and then click on the formula bar), place your curser at the point where you want a line break and press <ALT>-ENTER (ie. press the ALT key and while holding this down, press the Enter/Return key)


Merge Cells

  A B
1 This is a Merged
Cell, consisting of
cells A1 - A4
Individual Cell B1
2 Individual Cell B2
3 Individual Cell B3
4 Individual Cell B4

The Merge Cells option is also controlled by a tick-box in the Alignment tab of the Format Cells control box. When ticked, this option forces the selected cells to merge together and be treated as one larger cell. This is shown in the example spreadsheet on the left.







Disclaimer Privacy Policy

Copyright © 2008-2010 ExcelFunctions.net