Formatting and Page Setup
Scope
Formatting and Page Setup covers how values are displayed and how a sheet is prepared for output: number formats, cell styles, conditional formatting, alignment and page layout.
Number formats
The Format Cells dialog offers General, Number, Currency, Accounting, Date, Percentage, Fraction, Scientific, Text, Special and Custom. Custom codes use 0 (forced digit), # (optional digit) and ? (space placeholder), with up to four sections separated by semicolons: positive; negative; zero; text. A format of 0.00;[Red]-0.00 shows negatives in red with a minus sign. Formatting never changes the stored value.
Cells and conditional formatting
Cell styles bundle font, fill, border and number format. Format Painter copies formatting; double-click it to apply to several ranges. Merge & Center keeps only the upper-left value. Conditional formatting applies rules such as highlight cells, top/bottom, data bars, color scales and icon sets; formula-based rules are written relative to the top-left cell of the applied range, evaluated in rule order, with Stop If True available.
Page setup
Page Layout controls orientation, paper size, margins, scaling (Adjust to % or Fit to n pages wide by m tall), print titles (repeat rows or columns), print area and headers/footers, which accept codes such as &[Page], &[Date] and &[File]. Gridlines and row/column headings print only when their checkboxes are ticked.
Worked example
To shade entire rows A2:C10 when the value in column B exceeds 100: select A2:C10 with A2 active, choose Conditional Formatting > New Rule > Use a formula, and enter =$B2>100. The column is locked with $ so every column tests column B, while the row stays relative so the rule moves down each row.
Traps
- Merged cells break sorting, filtering and fill-down.
- A formula rule written with the wrong active cell shades the wrong cells.
- Formatting a text-number as Number does not convert it; use Text to Columns or multiply by 1.
- Conditional formatting sits above manual fill colour.