Excel Number Formatting Add Parentheses For Negative Numbers Mac

Jul 16, 2015  In Excel:Mac 2011 and Excel 2013 for Windows, the default format for negative numbers when using the accounting format was to use parenthesis: $(300). Well, in Excel 2016 the default format is to use a negative sign: -$300. That is NOT acceptable. I contacted Microsoft support and they said. Oct 13, 2015  Working with accountants, one of the requirements I often get asked for, is to show negative numbers in brackets. Surprisingly, this is not one of the standard number formats in Excel, not even if you choose the Accounting format! Fortunately, however, this can be remedied using a.

Introduction

Number formats control how numbers are displayed in Excel. The key benefit of number formats is that they change how a number looks without changing any data. They are a great way to save time in Excel because they perform a huge amount of formatting automatically. As a bonus, they make worksheets look more consistent and professional.

Video: What is a number format

What can you do with custom number formats?

Custom number formats can control the display of numbers, dates, times, fractions, percentages, and other numeric values. Using custom formats, you can do things like format dates to show month names only, format large numbers in millions or thousands, and display negative numbers in red.

Where can you use custom number formats?

Many areas in Excel support number formats. You can use them in tables, charts, pivot tables, formulas, and directly on the worksheet.

  • Worksheet - format cells dialog
  • Pivot Tables - via value field settings
  • Charts - data labels and axis options
  • Formulas - via the TEXT function

What is a number format?

A number format is a special code to control how a value is displayed in Excel. For example, the table below shows 7 different number formats applied to the same date, January 1, 2019:

InputCodeResult
1-Jan-2019yyyy2019
1-Jan-2019yy19
1-Jan-2019mmmJan
1-Jan-2019mmmmJanuary
1-Jan-2019d1
1-Jan-2019dddTue
1-Jan-2019ddddTuesday

The key thing to understand is that number formats change the way numeric values are displayed, but they do not change the actual values.

Where can you find number formats?

On the home tab of the ribbon, you'll find a menu of build-in number formats. Below this menu to the right, there is small button to access all number formats, including custom formats:

This button opens the Format Cells dialog box. You'll find a complete list of number formats, organized by category, on the Number tab:

Note: you can open Format Cells dialog box with the keyboard shortcut Control + 1.

General is default

By default, cells start with the General format applied. The display of numbers using the General number format is somewhat 'fluid'. Excel will display as many decimal places as space allows, and will round decimals and use scientific number format when space is limited. The screen below shows the same values in column B and D, but D is narrower and Excel makes adjustments on the fly.

How to change number formats

You can select standard number formats (General, Number, Currency, Accounting, Short Date, Long Date, Time, Percentage, Fraction, Scientific, Text) on the home tab of the ribbon using the Number Format menu.

Note: As you enter data, Excel will sometimes change number formats automatically. For example if you enter a valid date, Excel will change to 'Date' format. If you enter a percentage like 5%, Excel will change to Percentage, and so on.

Shortcuts for number formats

Excel provides a number of keyboard shortcuts for some common formats:

FormatShortcut
General formatCtrl Shift ~
Currency formatCtrl Shift $
Percentage formatCtrl Shift %
Scientific formatCtrl Shift ^
Date formatCtrl Shift #
Time formatCtrl Shift @
Custom formatsControl + 1

See also: 222 Excel Shortcuts for Windows and Mac

Where to enter custom formats

At the bottom of the predefined formats, you'll see a category called custom. The Custom category shows a list of codes you can use for custom number formats, along with an input area to enter codes manually in various combinations.

When you select a code from the list, you'll see it appear in the Type input box. Here you can modify existing custom code, or to enter your own codes from scratch. Excel will show a small preview of the code applied to the first selected value above the input area.

Note: Custom number formats live in a workbook, not in Excel generally. If you copy a value formatted with a custom format from one workbook to another, the custom number format will be transferred into the workbook along with the value.

How to create a custom number format

To create custom number format follow this simple 4-step process:

  1. Select cell(s) with values you want to format
  2. Control + 1 > Numbers > Custom
  3. Enter codes and watch preview area to see result
  4. Press OK to save and apply

Tip: if you want base your custom format on an existing format, first apply the base format, then click the 'Custom' category and edit codes as you like.

How to edit a custom number format

You can't really edit a custom number format per se. When you change an existing custom number format, a new format is created and will appear in the list in the Custom category. You can use the Delete button to delete custom formats you no longer need.

Warning: there is no 'undo' after deleting a custom number format!

Structure and Reference

Excel custom number formats have a specific structure. Each number format can have up to four sections, separated with semi-colons as follows:

This structure can make custom number formats look overwhelmingly complex. To read a custom number format, learn to spot the semi-colons and mentally parse the code into these sections:

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

Not all sections required

Although a number format can include up to four sections, only one section is required. By default, the first section applies to positive numbers, the second section applies to negative numbers, the third section applies to zero values, and the forth section applies to text.

  • When only one format is provided, Excel will use that format for all values.
  • If you provide a number format with just two sections, the first section is used for positive numbers and zeros, and the second section is used for negative numbers.
  • To skip a section, include a semi-colon in the proper location, but don't specify a format code.

Characters that display natively

Some characters appear normally in a number format, while others require special handling. The following characters can be be used without any special handling:

CharacterComment
$Dollar
+-Plus, minus
()Parentheses
{}Curly braces
<>Less than, greater than
=Equal
:Colon
^Caret
'Apostrophe
/Forward slash
!Exclamation point
&Ampersand
~Tilde
Space character

Escaping characters

Some characters won't work correctly in a custom number format without being escaped. For example, the asterisk (*), hash (#), and percent (%) characters can't be used directly in a custom number format – they won't appear in the result. The escape character in custom number formats is the backslash (). By placing the backslash before the character, you can use them in custom number formats:

ValueCodeResult
100#0#100
100*0*100
100%0%100

Placeholders

Certain characters have special meaning in custom number format codes. The following characters are key building blocks:

CharacterPurpose
0Display insignificant zeros
#Display significant digits
?Display aligned decimals
.Decimal point
,Thousands separator
*Repeat digit
_Add space
@Placeholder for text

Zero (0) is used to force the display of insignificant zeros when a number has fewer digits than than zeros in the format. For example, the custom format 0.00 will display zero as 0.00, 1.1 as 1.10 and .5 as 0.50.

Pound sign (#) is a placeholder for optional digits. When a number has fewer digits than # symbols in the format, nothing will be displayed. For example, the custom format #.## will display 1.15 as 1.15 and 1.1 as 1.1.

Question mark (?) is used to align digits. When a question mark occupies a place not needed in a number, a space will be added to maintain visual alignment.

Period (.) is a placeholder for the decimal point in a number. When a period is used in a custom number format, it will always be displayed, regardless of whether the number contains decimal values.

Comma (,) is a placeholder for the thousands separators in the number being displayed. It can be used to define the behavior of digits in relation to the thousands or millions digits.

Asterisk (*) is used to repeat characters. The character immediately following an asterisk will be repeated to fill remaining space in a cell.

Underscore (_) is used to add space in a number format. The character immediately following an underscore character controls how much space to add. A common use of the underscore character is to add space to align positive and negative values when a number format is adding parentheses to negative numbers only. For example, the number format '0_);(0)' is adding a bit of space to the right of positive numbers so that they stay aligned with negative numbers, which are enclosed in parentheses.

At (@) - placeholder for text. For example, the following number format will display text values in blue:

See below for more information about using color.

Automatic rounding

It's important to understand the Excel will perform 'visual rounding' with all custom number formats. When a number has more digits than placeholders on the right side of the decimal point, the number is rounded to the number of placeholders. When a number has more digits than placeholders on the left side of the decimal point, extra digits are displayed. This is a visual effect only; actual values are not modified.

Number formats for TEXT

To display both text along with numbers, enclose the text in double quotes ('). You can use this approach to append or prepend text strings in a custom number format, as shown in the table below.

ValueCodeResult
10General' units'10 units
100.0' units'10.0 units
5.50.0' feet'5.5 feet
300000' feet'30000 feet
95.2'Score: '0.0Score: 95.2
1-Jun'Date: 'mmmm dDate: June 1

Number formats for DATES

Dates in Excel are just numbers, so you can use custom number formats to change the way they display. Excel many specific codes you can use to display components of a date in different ways. The screen below shows how Excel displays the date in D5, September 3, 2018, with a variety of custom number formats:

Number formats for TIME

Times in Excel are fractional parts of a day. For example, 12:00 PM is 0.5, and 6:00 PM is 0.75. You can use the following codes in custom time formats to display components of a time in different ways. The screen below shows how Excel displays the time in D5, 9:35:07 AM, with a variety of custom number formats:

How to remove toggle field codes in word. Note: m and mm can't be used alone in a custom number format since they conflict with the month number code in date format codes.

Number formats for ELAPSED TIME

Elapsed time is a special case and needs special handling. By using square brackets, Excel provides a special way to display elapsed hours, minutes, and seconds. The following screen shows how Excel displays elapsed time based on the value in D5, which represents 1.25 days:

Number formats for COLORS

Excel provides basic support for colors in custom number formats. The following 8 colors can be specified by name in a number format: [black] [white] [red][green] [blue] [yellow] [magenta] [cyan]. Color names must appear in brackets.

Colors by index

In addition to color names, it's also possible to specify colors by an index number (Color1,Color2,Color3, etc.) The examples below are using the custom number format: [ColorX]0'▲▼', where X is a number between 1-56:

The triangle symbols have been added only to make the colors easier to see. The first image shows all 56 colors on a standard white background. The second image shows the same colors on a gray background. Note the first 8 colors shown correspond to the named color list above.

Apply number formats in a formula

Although most number formats are applied directly to cells in a worksheet, you can also apply number formats inside a formula with the TEXT function. For example, with a valid date in A1, the following formula will display the month name only:

The result of the TEXT function is always text, so you are free to concatenate the result of TEXT to other strings:

It’s not uncommon to have reporting that joins text with numbers. For example, you may be required to show a line in your report that summarizes a salesperson’s results, like this:

John Hutchison: $5,000

The problem is that when you join numbers in a text string, the number formatting does not follow. Take a look at the figure as an example. Note how the numbers in the joined strings (column E) do not adopt the formatting from the source cells (column C).

To solve this problem, you have to wrap the cell reference for your number value in the TEXT function. Using the TEXT function, you can apply the needed formatting on the fly. The formula shown here resolves the issue:

The TEXT function requires two arguments: a value, and a valid Excel format. You can apply any formatting you want to a number as long as it’s a format that Excel recognizes.

For example, you can enter this formula into Excel to display $99:

You can enter this formula into Excel to display 9921%:

You can enter this formula into Excel to display 99.2:

An easy way to get the syntax for a particular number format is to look at the Number Format dialog box. To see that dialog box and get the syntax, follow these steps:

  1. Right-click any cell and select Format Cell.

  2. On the Number format tab, select the formatting you need.

  3. Select Custom from the Category list on the left of the Number Format dialog box.

  4. Copy the syntax found in the Type input box.