Wauvel

Excel like a finance pro.

← The library

VBA · Syntax

Format

Formats a number or date as text, like TEXT in a sheet.

CommonDifficulty 1100 · Proficient
Practice · 2 questions →

When to use it

Format converts numbers and dates to text with a format string, the VBA version of TEXT. Used for messages, file names, and labels.

The code

Code
Format(Date, "yyyy-mm-dd")
Format(x, "#,##0.00")

Worked examples

  • ISO date

    Format(Date, "yyyy-mm-dd") "2026-09-06"

    Sortable date text for file names.

  • Number

    Format(x, "#,##0.00") "12,345.68"

    Number with separators.

  • Percent

    Format(0.256, "0.0%") "25.6%"

    Percent.

Worth knowing

  • Named formats: "Currency", "Standard", "Percent", "Short Date".
  • The result is text; keep the number for math.
  • Format uses the system locale for month names.

Where it goes wrong

  • Format(5, "0.00") returns text, which sorts as text.
  • Locale differences change the output on other machines.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.