Number Formatting in Excel

Lab Manual: Practical 1 – Number Formatting

Course: Advanced Excel with Visualization
Course Code: CAD41VSP201
Practical Number: 1
Topic: Number Formatting in Microsoft Excel
Duration: 2 Hours

 

1. Objective

The objective of this practical session is to enable students to:

  • Understand various number formatting options in Microsoft Excel.
  • Enhance data readability, accuracy, and presentation without altering the underlying values.
  • Apply both standard and custom number formats for different data types.

 

2. Introduction to Number Formatting

In Excel, data can be entered as numbers, text, dates, or times. While the cell’s actual value remains unchanged, its display can be modified using number formatting. Proper formatting is essential for:

  • Readability: Makes large datasets easier to interpret.
  • Clarity: Ensures values are represented in a universally understood format (e.g., currency, percentages).
  • Professionalism: Creates well-structured, presentable reports and dashboards.

This practical introduces common number formats and demonstrates how to use custom formatting for specific requirements.

 

3. Prerequisites

Before starting this practical, students should:

  • Be familiar with the Microsoft Excel interface.
  • Know how to open, save, and navigate worksheets.
  • Have basic data entry skills.

 

4. Software Requirement

  • Microsoft Excel (2016 or newer version, as specified in the syllabus).

 

5. Procedure: Step-by-Step Practical

Follow these steps to learn and apply number formatting in Excel.

 

Step 5.1: Creating a Workbook and Entering Data

1.     Open Excel → Select Blank Workbook.

2.     Rename Sheet → Double-click Sheet1 and rename it to Data Formatting.

3.     Enter the following data starting from cell A1:

Category

Value 1

Value 2

Value 3

Sales Amount

12345.6789

5000

250000

Growth Rate

0.15

0.05

0.75

Item Count

123456

45000

100000

Date Recorded

44789

44800

44700

Time Recorded

0.5

0.25

0.75

Product Code

00123

567

00987

Temperature

23.56

30

-5

Budget

1500000

800000

-200000

 

Step 5.2: Applying Basic Number Formats

  • Currency Format
    • Select B2:D2 → Home → Number group → $ symbol.
    • Observe the currency symbol and two decimal places.
  • Percentage Format
    • Select B3:D3 → Home → Number group → % symbol.
    • Adjust decimals using the Increase/Decrease Decimal buttons.
  • Comma Style (Thousands Separator)
    • Select B4:D4 → Home → Number group , button.

Step 5.3: Formatting Dates and Times

  • Short Date
    • Select B5:D5 → Home → Number group → Choose Short Date.
  • Long Date
    • With B5:D5 still selected → Choose Long Date.
  • Time Format
    • Select B6:D6 → Format as Time.

Step 5.4: Using the Format Cells Dialog (Ctrl + 1)

  • Press Ctrl + 1 or right-click → Format Cells.
  • Explore:
    • Currency: Change symbols and negative number formats.
    • Date/Time: Choose different display styles.
    • Special: Useful for codes like Zip Codes or IDs.
    • Custom: Define your own format (e.g., 00000 for Product Codes).

Step 5.5: Handling Negative Numbers

  • Select B8:D8 → Format as Number → Choose negative display (red or in parentheses).
  • Select B9:D9 → Format as Currency → Show negatives in red and/or with parentheses.

Step 5.6: Custom Number Formats

Custom formats use four sections: Positive; Negative; Zero; Text

Examples:

  • Product Codes: 00000 → Ensures leading zeros.
  • Sales Label: "Sales: " #,##0.00 → Displays Sales: 12,345.68.
  • Advanced: #,##0.00;[Red](#,##0.00);"No Budget";"Invalid Data"

 

 

 

Understanding Custom Number Formatting in Excel

Excel stores all numbers, dates, and times as numerical values.

  • Example: The date 26-Aug-2025 is stored as a serial number (e.g., 45914).
  • The time 12:00 PM is stored as 0.5.

Number formatting only changes how a value appears—it does not change the actual value stored in the cell.

Custom number formats allow you to define your own display style using special codes.


How to Access Custom Number Formats

1.     Select the cell(s) you want to format.

2.     Press Ctrl + 1 (or right-click → Format Cells…).

3.     Go to the Number tab.

4.     Choose Custom from the Category list.

5.     In the Type field, enter your custom format code.

Structure of a Custom Number Format

A custom format can have up to four parts, separated by semicolons (;):

Positive Format ; Negative Format ; Zero Format ; Text Format

Each part controls how a specific type of value is displayed:

1.     Positive numbers

2.     Negative numbers

3.     Zero values

4.     Text

If you leave out any part, Excel uses the default format for that category.

 

1. Positive Number Format

This section defines how positive numbers are displayed.

Example: Add two decimal places, a thousands separator, and "Units".

Underlying Value

Custom Format

Displayed As

Explanation

12345.67

#,##0.00 "Units"

12,345.67 Units

#,##0.00 formats the number, "Units" adds text

500

#,##0 "Widgets"

500 Widgets

Displays without decimals, adds "Widgets"

 

2. Negative Number Format

This section defines how negative numbers are displayed (second section after a semicolon). Often, negatives are shown in red or within parentheses.

Example: Show positive numbers normally, negatives in red with parentheses.

Underlying Value

Custom Format

Displayed As

Explanation

15000

#,##0;[Red](#,##0)

15,000

First part formats positive numbers

-5000

#,##0;[Red](#,##0)

(5,000) (Red)

[Red](#,##0) applies to negatives

0

#,##0;[Red](#,##0)

0

Zero is not defined, so defaults to general

 

3. Zero Value Format

This section controls how zero values appear.

Example: Display "N/A" for zero.

Underlying Value

Custom Format

Displayed As

Explanation

75

General;General;"N/A"

75

General for positive

-10

General;General;"N/A"

-10

General for negative

0

General;General;"N/A"

N/A

Third part displays text for zero

 

4. Text Format

This section defines how text values are displayed.

Example: Add "Error: " before any text entered.

Underlying Value

Custom Format

Displayed As

Explanation

123

General;General;General;"Error: "@

123

Numbers remain unchanged

Data Missing

General;General;General;"Error: "@

Error: Data Missing

@ represents the cell text

 

Common Custom Format Codes

  • 0 → Digit placeholder (displays extra zeros)
    • Example: 000 with value 12012
  • # → Digit placeholder (no extra zeros)
    • Example: ### with value 1212
  • . → Decimal point
  • , → Thousands separator
  • % → Percentage (multiplies by 100)
  • ? → Space placeholder (align decimals)
  • "text" → Literal text
  • @ → Text placeholder
  • [Color] → Display color (e.g., [Red], [Green])
  • [Condition] → Conditional format (e.g., [>100])

Assessment / Deliverables

  • Submit the completed Excel workbook (.xlsx file) with both the Data Formatting sheet and the solution sheets for Student Scores and Inventory.
  • Ensure all formatting requirements are met precisely.

Exercises / Tasks

Apply the concepts learned to complete the following tasks:

1.     New Sheet for Student Scores: Create a new worksheet named Student Scores.

o    Enter the following data:

Student ID

Marks Obtained

Max Marks

Result

S001

75

100

S002

88

100

S003

42

60

S004

30

40

S005

95

100

o    Task A: In column D (Result), calculate the Percentage for each student (Marks Obtained / Max Marks). Format this column as Percentage with one decimal place.

o    Task B: Apply a custom number format to the Student ID column (A) so that S001 appears as STUDENT-001. (Hint: use "STUDENT-"000 in custom format).

2.     New Sheet for Inventory Data: Create a new worksheet named Inventory.

o    Enter the following data:

Product

Quantity In Stock

Cost Per Unit

Total Value

Last Updated

Laptop

50

1200

44800