Look at the Type list in the Number tab of the Format Cell dialog box. These format specifications follow a pattern you must know if you want to use them or create a custom format.
Look at the custom formats in the Type list and notice that they can have up to four parts. Each part is separated by a semi-colon.
Positive format; Negative format ; Zero format ; Text format
Special characters are used inside each segment to specify how numbers or dates appear. For example,
Formats positive numbers so they have a leading dollar sign, have two decimal places and leave a space at the right side so they will align with negative numbers that are enclosed by parenthesis. Negative numbers are in red, surrounded by parenthesis, have a leading dollar sign and two decimals.