Confident CellsExcel practice Start free

Number formats and your own format codes: practice exercises

Currency, Percentage, Increase Decimal, Short Date, Custom number formats: 0.0 "kg", #,##0,"k", [Red], dddd, @, conditions. 7 exercises on real-looking data, each checked as you go. The full lesson is part of Pro.

In the lesson

This lesson has a strip of Excel's Home tab buttons and the Format Cells dialog above a practice sheet: format the cells as you would in Excel, and each task is checked as you go.

Open the Number formats and your own format codes lesson

How it works

A number format changes how a number shows, not the number itself. 1234.5 can show as £1,234.50, 1,235, 1k or 123450%, and sums still use 1234.5.

The common ones are on the Home tab. For anything else, write a format code of your own in the Custom category of Format Cells: add units such as kg, show thousands as k, colour minus numbers red, or show a date as its day name.

Number formats on the Home tab

The prices in column C are plain numbers: 4.5, 12, 36.99. Select them and pick Currency in the Number Format list on the Home tab, and they show as £4.50, £12.00, £36.99. The cells still hold 4.5, 12 and 36.99.

  • Number: two decimal places. Currency: a £ sign too. Short Date and Long Date: 23/11/2026 or 23 November 2026.
  • Percent Style (%): 0.25 shows as 25%. Comma Style: a comma between thousands.
  • Increase Decimal and Decrease Decimal: one more or one fewer decimal place, each click. 0.9634 at 0% shows 96%; one click more shows 96.3%.

Rounding on screen isn't rounding the number: 96.34% shown as 96% still counts as 0.9634 in a sum. Use ROUND when the number itself should change.

Windows: Home tab, Number group: the Number Format list, %, the comma, and the two decimal buttons.

Mac: Home tab: the Number Format list and the buttons under it.

Writing your own format code

Open Format Cells (Ctrl+1), go to the Number tab and choose Custom. The Type box holds the code, and the Sample shows the first selected cell with it.

  • 0 is a digit that always shows; # shows only if needed. 0.0 gives one decimal place: 2.46 shows as 2.5.
  • #,##0 puts a comma between thousands: 12,500.
  • Text in quote marks shows as it is: 0.0 "kg" shows 2.46 as 2.5 kg, and the cell still holds a number you can add up.
  • A comma after the last 0 divides by 1,000: #,##0,"k" shows 348,250 as 348k.
  • % multiplies by 100 and adds the % sign.

Windows: right-click the cells, Format Cells…, Number tab, Custom. Or Home, Number Format list, More Number Formats….

Mac: right-click (or Control-click), Format Cells…, Number, Custom. Or the Format menu at the top of the screen, Cells….

Sections, colours, dates and text

A code can have up to four parts, split by semicolons: plus numbers; minus numbers; zero; text. #,##0;[Red]-#,##0;"-" shows 1500 as 1,500, -1500 as -1,500 in red, and 0 as a dash.

  • Colours go in square brackets at the start of a part: [Red], [Blue], [Green] and a few more.
  • A condition in square brackets picks its own numbers: [>=1000]#,##0,"k";0 shows 1000 and over in thousands, and anything smaller as it is.
  • Dates: dd/mm/yyyy gives 23/11/2026, d mmm gives 23 Nov, ddd gives Mon and dddd gives Monday. h:mm AM/PM shows a time as 3:30 PM.
  • For text, @ stands for what's in the cell: "Due "@ shows Friday as Due Friday.

What you'll practise

  1. Show the prices in C2:C9 as money: pounds with two decimal places. Select them and choose Currency in the Number Format list.
  2. Column E shows each team's actual sales as a share of its target, as decimals like 0.9634. Show E2:E6 as percentages with one decimal place: click Percent Style (%), then Increase Decimal once.
  3. Show the weights in B2:B9 with one decimal place and kg after them, like 2.5 kg, without typing kg into the cells. Open Format Cells…, Number tab, Custom, and type the code 0.0 "kg".
  4. A chart of these sales would be easier to read in thousands. Show B2:B7 in thousands with a k after them, like 348k: Custom code #,##0,"k". The comma after the last 0 divides by 1,000 on screen, and the numbers themselves don't change.
  5. Make the teams that missed their target stand out. Show the differences in D2:D6 with a comma and no decimals, and the minus ones in red with a minus sign: Custom code #,##0;[Red]-#,##0. The part after the semicolon is for minus numbers.
  6. Apply a custom number format to B2:B9 so that the dates display the full name of the day, such as Monday.
  7. Apply a custom number format to C2:C8 so that each entry is shown with the word Due and a space in front of it, such as Due next week in C2, without changing what the cells contain.

Guide with worked examples: The TEXT function: day names, leading zeros and £ in a sentence