Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to make custom number formats

Make custom number formats in Grid by Zaweba under Format Cells, Number, Custom, with a live sample, sections, colours, conditions and text.

How to make custom number formats

Open Format Cells and go to Number, then Custom. In Grid by Zaweba, Ctrl+1 opens Format Cells, and the Custom category lets you type a format code and see a live sample of how the active cell will look. Codes follow the standard spreadsheet rules, so formats you know from elsewhere work here too.

Why use a custom format

A number format changes how a value looks, never the value itself. That means you can show 1500 as 1.5k, add kg after a weight, show negative amounts in red with brackets, or display a date as Tuesday 4 March, while the cell still holds a number you can add up, sort and chart. Typing the unit as text would break all of that.

The building blocks

A 0 shows a digit, always, including leading or trailing zeros. A # shows a digit only when needed. A comma between digits adds thousands separators, and a full stop marks the decimal point. So #,##0.00 shows 1234.5 as 1,234.50.

Text in double quotes is shown as written: 0.0 " kg" shows 12.5 kg. A question mark leaves space for a digit, so columns of decimals line up neatly on the point. A comma at the end of the number part scales it by a thousand, which suits figures shown in thousands.

For dates and times, d, m and y build the date, h, m and s the time, and longer codes give longer forms, so ddd gives the short weekday name and mmmm the full month name. Square brackets around h, as in [h]:mm, show elapsed time beyond 24 hours, which is what a timesheet total needs.

Sections, colours and conditions

A format can have up to four sections separated by semicolons: positive; negative; zero; text. So #,##0.00;[Red](#,##0.00);"nil" shows positives normally, negatives in red brackets and zero as the word nil.

Colours go in square brackets at the start of a section. Conditions can go in square brackets too, such as [>=1000] for values of a thousand or more, so you can format large and small numbers differently within one code.

Making a format step by step

Select the cells, press Ctrl+1, choose Number and then Custom. Start from a built-in category that's close to what you want, then switch to Custom to see its code and change it. Watch the sample as you type. When it looks right, apply it.

For quick changes the ribbon has a number-format box and buttons, which are faster than the dialog for common formats.

Using formats in formulas

The TEXT function uses the same codes. =TEXT(A2,"dd mmm yyyy") turns a date into text in that style, handy for building labels such as Invoice date 04 Mar 2025 in a single cell. Remember that the result is text, so keep the original value for any sums.

Formats that mislead

Formatting doesn't round the stored number. A cell formatted to show 0 decimal places still holds the decimals, and a sum of rounded-looking figures may not match what you add up in your head. Use ROUND where the stored value must change.

Hashes across a cell, ####, mean the number is too wide for the column, not that the format is wrong. Widen the column or AutoFit it.

Custom formats are saved in .xlsx and .zagr files, so they travel with the workbook. In Grid by Zaweba, sections, colours, conditions, elapsed time, fractions and scientific notation all follow the rules spreadsheet users already know.