Skip to content
v0.1.0latest release21 skills2 categories3 sub-categories22 tested scripts68 reference docsContact us

Formatting Reference

Reference for excel-fundamentals · 513 lines

Productivity / Excelv1.0.0Updated OCT 20 20264 references1 script

Complete guide to number formats, cell styles, borders, colors, and conditional formatting in Excel.

Number Format Categories

Built-in Categories

CategoryDescriptionExample
GeneralDefault, no specific format1234.567
NumberDecimal places, thousands separator1,234.57
CurrencyCurrency symbol, decimals$1,234.57
AccountingAligned currency, negatives in parentheses$ 1,234.57
DateDate formats1/15/2024
TimeTime formats3:30 PM
PercentageMultiply by 100, add %15.50%
FractionDisplay as fraction1/2
ScientificExponential notation1.23E+03
TextTreat as text001234
SpecialZIP codes, phone numbers, SSN(555) 123-4567
CustomUser-defined formatCustom

Number Format Options

OptionEffect
Decimal places0-30 decimal positions
Use 1000 separatorAdd commas (1,234)
Negative numbersRed, parentheses, or minus sign
Display zerosShow or hide zero values

Custom Number Format Codes

Format Code Structure

text
positive;negative;zero;text

Up to four sections separated by semicolons:

  1. Positive numbers
  2. Negative numbers
  3. Zero values
  4. Text

Basic Codes

CodeMeaningExample InputResult
0Display digit or zero0.00 with 1.51.50
#Display digit or nothing#.## with 1.51.5
?Display digit or space?.?? with 1.51.5
.Decimal point0.001.50
,Thousands separator#,##01,234
,Scale by 1000 (at end)#,1 (for 1234)

Text and Symbols

CodeMeaningExample
"text"Literal text0 "units" -> "5 units"
@Text placeholder@ " items"
*Repeat character*-0 -> ----5
_Skip width of character_( for alignment
\Escape next character$ -> $

Color Codes

CodeColor
[Black]Black
[Blue]Blue
[Cyan]Cyan
[Green]Green
[Magenta]Magenta
[Red]Red
[White]White
[Yellow]Yellow
[Color n]Color from palette (1-56)

Example:

text
[Green]#,##0;[Red]-#,##0;0

Condition Codes

CodeMeaning
[>100]Value greater than 100
[<0]Value less than 0
[>=50]Value greater than or equal
[<=50]Value less than or equal
[=0]Value equals 0
[<>0]Value not equal to 0

Example:

text
[>=1000]#,##0,"K";[>=1]#,##0;0

Common Custom Formats

PurposeFormat Code
Phone number(###) ###-####
Social Security###-##-####
ZIP+4#####-####
Thousands (K)#,##0,"K"
Millions (M)#,##0.0,,"M"
Hide values;;;
Hide zeros#,##0;-#,##0;;
Leading zeros00000
Positive/negative symbols+#,##0;-#,##0;0
Text prefix"ID-"0000

Date and Time Formats

Date Codes

CodeMeaningExample
dDay (1-31)5
ddDay (01-31)05
dddDay abbreviationMon
ddddDay full nameMonday
mMonth (1-12)1
mmMonth (01-12)01
mmmMonth abbreviationJan
mmmmMonth full nameJanuary
mmmmmMonth letterJ
yyYear (00-99)24
yyyyYear (1900-9999)2024

Time Codes

CodeMeaningExample
hHour (0-23)3
hhHour (00-23)03
mMinute (0-59)5
mmMinute (00-59)05
sSecond (0-59)7
ssSecond (00-59)07
AM/PM12-hour with AM/PM3:05 PM
am/pm12-hour with am/pm3:05 pm
A/P12-hour with A/P3:05 P
[h]Elapsed hours[h]:mm
[m]Elapsed minutes[m]:ss
[s]Elapsed seconds[s]

Common Date/Time Formats

PurposeFormat CodeResult
Short datem/d/yyyy1/15/2024
Long datemmmm d, yyyyJanuary 15, 2024
ISO dateyyyy-mm-dd2024-01-15
Month-Yearmmm-yyyyJan-2024
Quarter"Q"qQ1
Time 12hh:mm AM/PM3:30 PM
Time 24hhh:mm15:30
Duration[h]:mm:ss25:30:00
Timestampyyyy-mm-dd hh:mm:ss2024-01-15 15:30:00

Font Formatting

Font Properties

PropertyOptions
Font nameArial, Calibri, Times New Roman, etc.
Font size1-409 points
Font styleRegular, Bold, Italic, Bold Italic
UnderlineSingle, Double, Single Accounting, Double Accounting
StrikethroughLine through text
SuperscriptRaised text
SubscriptLowered text
ColorFont color from palette

Default Fonts

ElementDefault
BodyCalibri 11pt
HeadingsCalibri Light
CommentsTahoma 9pt

Cell Styles

Built-in Styles

CategoryStyles
Good, Bad, NeutralData quality indicators
NormalDefault cell style
InputUser input cells
OutputCalculated cells
CalculationFormula cells
Check CellVerification cells
Linked CellExternal links
NoteInformation cells
Warning TextAlert text
Heading 1-4Header hierarchy
TitleMain title
TotalSummary rows

Creating Custom Styles

  1. Home > Cell Styles > New Cell Style
  2. Name the style
  3. Format: Number, Alignment, Font, Border, Fill, Protection
  4. Click OK

Modifying Styles

  1. Home > Cell Styles
  2. Right-click style > Modify
  3. Change format settings
  4. All cells using style update automatically

Borders

Border Positions

PositionDescription
BottomBottom edge only
TopTop edge only
LeftLeft edge only
RightRight edge only
No BorderRemove all borders
All BordersGrid around all cells
Outside BordersBorder around selection
Thick Box BorderHeavy outside border

Border Styles

StyleAppearance
NoneNo border
ThinHairline
MediumStandard weight
ThickHeavy weight
DoubleTwo parallel lines
HairThinnest visible
DottedDot pattern
DashedDash pattern
Dash-DotAlternating
Dash-Dot-DotComplex pattern
Slant Dash-DotDiagonal pattern

Border Colors

  • Select from theme colors
  • Standard colors
  • Custom RGB/HSL colors

Draw Borders

  1. Home > Borders dropdown > Draw Border
  2. Select line style and color
  3. Click and drag on cells

Fill (Background)

Solid Fill

  • Single background color
  • Most common fill type
  • Theme or custom colors

Pattern Fill

PatternUse Case
NoneNo pattern
SolidStandard fill
75% GrayHeavy shading
50% GrayMedium shading
25% GrayLight shading
12.5% GrayVery light
Horizontal StripeRow emphasis
Vertical StripeColumn emphasis
Diagonal StripeDirection indicator

Gradient Fill

  1. Format Cells > Fill > Fill Effects
  2. Choose two colors
  3. Select gradient style:
    • Horizontal
    • Vertical
    • Diagonal Up
    • Diagonal Down
    • From Corner
    • From Center

Alignment

Horizontal Alignment

OptionEffect
GeneralNumbers right, text left
LeftAlign to left edge
CenterCenter in cell
RightAlign to right edge
FillRepeat to fill cell
JustifySpread text evenly
Center Across SelectionCenter without merging
DistributedSpace between characters

Vertical Alignment

OptionEffect
TopAlign to top edge
CenterCenter vertically
BottomAlign to bottom edge
JustifySpread text vertically
DistributedEven vertical spacing

Text Control

OptionEffect
Wrap TextMultiple lines within cell
Shrink to FitReduce font to fit
Merge CellsCombine selected cells

Text Direction

OptionDegrees
Horizontal0
Vertical90 or -90
Angle-90 to 90
StackedVertical letters

Indent

  • Increase/decrease left margin
  • 0-15 character widths
  • Works with left or right alignment

Conditional Formatting

Rule Types

TypeDescription
Highlight Cells RulesBased on cell value
Top/Bottom RulesRank-based formatting
Data BarsBar length shows value
Color ScalesGradient based on value
Icon SetsSymbols based on value
Formula-basedCustom formula condition

Highlight Cells Rules

RuleExample
Greater Than> 100
Less Than< 50
Between50 and 100
Equal To= "Done"
Text That ContainsContains "Error"
A Date OccurringToday, Last Week, etc.
Duplicate ValuesHighlight duplicates
Unique ValuesHighlight unique

Top/Bottom Rules

RuleDescription
Top 10 ItemsHighest N values
Top 10%Top percentage
Bottom 10 ItemsLowest N values
Bottom 10%Bottom percentage
Above AverageAbove mean
Below AverageBelow mean

Data Bars

Options:

  • Gradient or solid fill
  • Positive/negative colors
  • Show or hide bar only
  • Minimum/maximum values
  • Bar direction

Color Scales

TypeDescription
2-ColorTwo-point gradient
3-ColorThree-point gradient (with midpoint)

Settings:

  • Minimum color and type
  • Midpoint color and type (3-color)
  • Maximum color and type

Icon Sets

CategoryExamples
DirectionalArrows, triangles
ShapesTraffic lights, flags
IndicatorsStars, checkmarks
RatingsBars, quarters

Options:

  • Show icon only
  • Reverse icon order
  • Custom thresholds

Formula-Based Rules

Use formulas returning TRUE/FALSE:

excel
=A1>100                          Value condition
=A1>AVERAGE($A:$A)               Compare to average
=ISBLANK(A1)                     Check for blanks
=MOD(ROW(),2)=0                  Alternate rows
=A1<>B1                          Compare columns
=COUNTIF($A:$A,A1)>1             Highlight duplicates

Managing Rules

  1. Home > Conditional Formatting > Manage Rules
  2. View all rules for sheet or selection
  3. Edit, delete, or change order
  4. Stop If True option

Rule Precedence

  • Rules evaluated top to bottom
  • First matching rule applies (unless continue)
  • "Stop If True" prevents further evaluation

Format Painter

Using Format Painter

  1. Select cell with desired format
  2. Click Format Painter (Home tab)
  3. Click or drag over target cells

Multiple Applications

  • Double-click Format Painter to lock
  • Apply to multiple ranges
  • Press Esc to deactivate

What Gets Copied

  • Number format
  • Font properties
  • Fill color
  • Borders
  • Alignment
  • Conditional formatting

Themes

Theme Components

ComponentControls
Colors12-color palette
FontsHeading and body fonts
EffectsShape and chart effects

Applying Themes

  1. Page Layout > Themes
  2. Choose built-in theme
  3. Or customize individual components

Theme Colors

PositionUsage
1-2Text/background (light/dark)
3-4Text/background (dark/light)
5-10Accent colors
11-12Hyperlink colors

Clear Formatting

Clear Options

OptionRemoves
Clear AllContents, formatting, comments
Clear FormatsOnly formatting
Clear ContentsOnly values/formulas
Clear CommentsOnly comments
Clear HyperlinksOnly hyperlinks

Keyboard Shortcuts

ActionShortcut
Clear contentsDelete
Clear allCtrl+Shift+Delete
Paste special (formats)Ctrl+Alt+V, then T
More in Excel