banner



4 15 As A Decimal

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 whatsoever data. They are a not bad way to save time in Excel because they perform a huge corporeality of formatting automatically. As a bonus, they make worksheets expect more consistent and professional.

Video: What is a number format

What can you do with custom number formats?

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

Sample custom number formats

Where can yous apply custom number formats?

Many areas in Excel support number formats. Yous 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 - information labels and axis options
  • Formulas - via the TEXT office

What is a number format?

A number format is a special code to control how a value is displayed in Excel. For case, the table below shows vii different number formats applied to the aforementioned date, Jan 1, 2019:

Input Code Result
1-Jan-2019 yyyy 2019
ane-Jan-2019 yy xix
1-Jan-2019 mmm January
1-Jan-2019 mmmm January
ane-Jan-2019 d i
one-January-2019 ddd Tue
1-January-2019 dddd Tuesday

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

Where tin can you find number formats?

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

Number format menu on Home tab of Ribbon

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

Format Cells dialog box on Number tab

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

General is default

Past default, cells get-go with the General format applied. The brandish of numbers using the General number format is somewhat "fluid". Excel will display as many decimal places equally space allows, and will circular decimals and utilize scientific number format when space is express. The screen below shows the same values in cavalcade B and D, just D is narrower and Excel makes adjustments on the wing.

General number format in narrow column

How to modify number formats

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

Note: Equally you enter information, Excel volition sometimes alter number formats automatically. For example if you lot enter a valid engagement, Excel will change to "Date" format. If y'all enter a percentage similar 5%, Excel will alter to Per centum, and then on.

Shortcuts for number formats

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

Format Shortcut
Full general format Ctrl Shift ~
Currency format Ctrl Shift $
Percentage format Ctrl Shift %
Scientific format Ctrl Shift ^
Date format Ctrl Shift #
Time format Ctrl Shift @
Custom formats Command + 1

See too: 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.

Custom category in format cells dialog box

When you select a code from the list, you'll see it appear in the Type input box. Here y'all can change 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 surface area.

Note: Custom number formats live in a workbook, not in Excel mostly. 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 unproblematic iv-pace procedure:

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

Tip: if you want base of operations 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 lot tin't really edit a custom number format per se. When you lot modify an existing custom number format, a new format is created and volition appear in the list in the Custom category. You can employ the Delete button to delete custom formats yous no longer need.

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

Construction and Reference

Excel custom number formats accept a specific construction. Each number format can have upwardly to iv sections, separated with semi-colons equally follows:

Custom number format structure

This structure can brand custom number formats look overwhelmingly circuitous. 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

Non all sections required

Although a number format can include up to 4 sections, only one section is required. By default, the commencement department applies to positive numbers, the 2nd department applies to negative numbers, the third section applies to zero values, and the fourth section applies to text.

  • When only one format is provided, Excel will utilise 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 department, include a semi-colon in the proper location, but don't specify a format code.

Characters that display natively

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

Graphic symbol Annotate
$ Dollar
+- Plus, minus
() Parentheses
{} Curly braces
<> Less than, greater than
= Equal
: Colon
^ Caret
' Apostrophe
/ Forrad 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 exist used directly in a custom number format – they won't appear in the result. The escape graphic symbol in custom number formats is the backslash (\). By placing the backslash before the character, you tin use them in custom number formats:

Value Code Event
100 \#0 #100
100 \*0 *100
100 \%0 %100

Placeholders

Certain characters have special significant in custom number format codes. The post-obit characters are key building blocks:

Character Purpose
0 Display insignificant zeros
# Display significant digits
? Display aligned decimals
. Decimal bespeak
, Thousands separator
* Repeat following graphic symbol
_ Add space
@ Placeholder for text

Zero (0) is used to force the display of insignificant zeros when a number has fewer digits than zeros in the format. For instance, the custom format 0.00 will display zero every bit 0.00, 1.one as 1.10 and .v equally 0.fifty.

Zero placeholder examples

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 brandish 1.fifteen every bit 1.fifteen and i.1 as ane.1.

Pound placeholder examples

Question mark (?) is used to marshal digits. When a question marking occupies a identify not needed in a number, a infinite will exist added to maintain visual alignment.

Question mark placeholder examples

Period (.) is a placeholder for the decimal point in a number. When a catamenia is used in a custom number format, information technology volition ever exist displayed, regardless of whether the number contains decimal values.

Comma (,) is a placeholder for the thousands separators in the number being displayed.  Information technology can exist used to ascertain the behavior of digits in relation to the thousands or millions digits.

Comma placeholder examples

Asterisk (*) is used to repeat characters. The character immediately post-obit an asterisk will exist repeated to fill remaining infinite in a prison cell.

Asterisk placeholder examples

Underscore (_) is used to add space in a number format. The character immediately following an underscore grapheme controls how much space to add. A common use of the underscore graphic symbol 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 scrap of space to the correct of positive numbers so that they stay aligned with negative numbers, which are enclosed in parentheses.

Underscore placeholder examples

At (@) - placeholder for text. For instance, the post-obit number format volition display text values in blueish:

            0;0;0;[Blueish]@                      

See below for more information about using color.

Automatic rounding

It's important to understand that Excel will perform "visual rounding" with all custom number formats. When a number has more than 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 forth with numbers, enclose the text in double quotes ("").  You tin utilise this  arroyo to append or prepend text strings in a custom number format, as shown in the tabular array below.

Value Code Event
10 General" units" 10 units
10 0.0" units" 10.0 units
5.5 0.0" feet" 5.5 feet
30000 0" feet" 30000 feet
95.two "Score: "0.0 Score: 95.2
1-Jun "Date: "mmmm d Date: June 1

Number formats for DATES

Dates in Excel are just numbers, so you can utilise custom number formats to modify the mode they display. Excel has many specific codes you can use to display components of a date in dissimilar ways. The screen below shows how Excel displays the date in D5, September 3, 2018, with a diversity of custom number formats:

Number format codes for dates

Number formats for TIME

Times in Excel are fractional parts of a 24-hour interval. For instance, 12:00 PM is 0.5, and vi:00 PM is 0.75. You lot can utilise the following codes in custom time formats to brandish components of a time in different ways. The screen beneath shows how Excel displays the time in D5, 9:35:07 AM, with a variety of custom number formats:

Number format codes for times

Notation: thousand and mm tin 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 Fourth dimension

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

Number format codes for elapsed time

Number formats for COLORS

Excel provides basic back up for colors in custom number formats. The following 8 colors can be specified by proper noun in a number format: [blackness] [white] [scarlet][green] [blueish] [yellow] [magenta] [cyan]. Colour names must appear in brackets.

Custom number format with colors

Colors by index

In addition to colour 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 Ten is a number between 1-56:

            [Color1]0"▲▼" // blackness [Color2]0"▲▼" // white [Color3]0"▲▼" // cherry-red [Color4]0"▲▼" // green etc.                      

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

Custom number format colors on white

Custom number format colors on gray background

Apply number formats in a formula

Although most number formats are practical direct to cells in a worksheet, yous can besides apply number formats inside a formula with the TEXT part. For example, with a valid date in A1, the following formula volition display the calendar month name but:

            =TEXT(A1,"mmmm")                      

The outcome of the TEXT function is always text, so y'all are free to concatenate the result of TEXT to other strings:

            ="The contract expires in "&TEXT(A1,"mmmm")                      

The screen below shows the number formats in column C being applied to numbers in column B using the TEXT role:

Applying number formats with the TEXT function

Measurements

You can apply a custom number format to display numbers with an inches marker (") or a feet mark ('). In the screen below, the number formats used for inches and anxiety are:

            0.00 \' // anxiety 0.00 \" // inches                      

Number formats for feet and inches

These results are simplistic, and can't be combined in a unmarried number format. You can however use a formula to display feet together with inches.

Conditionals

Custom number formats besides up to two weather, which are written in square brackets like [>100] or [<=100]. When you use conditionals in custom number formats, you override the standard [positive];[negative];[zero];[text] structure. For instance, to display values below 100 in scarlet, you can utilize:

[Crimson][<100]0;0

To display values greater than or equal to 100 in bluish, you can extend the format like this:

[Ruby][<100]0;[Blue][>=100]0

Conditions with custom number formats

To apply more than ii weather condition, or to modify other cell attributes, like fill colour, etc. you'll need to switch to Conditional Formatting, which can utilize formatting with much more ability and flexibility using formulas.

Plural text labels

Yous can utilise conditionals to add an "south" to labels greater than zero with a custom format like this:

[=one]0" day";0" days"

Custom number format for plural text

Phone numbers

Custom number formats can also be used for telephone numbers, as shown in the screen below:

Custom number format for telephone numbers

Notice the third and fourth examples utilize a conditional format to check for numbers that contain an surface area code. If you have information that contains telephone numbers with hard-coded punctuation (parentheses, hyphens, etc.) you will need to make clean the telephone numbers first so that they only contain numbers.

Hide all content

You can really use a custom number format to hide all content in a jail cell. The code is but three semi-colons and nothing else ;;;

To reveal the content again, you can employ the keyboard shortcut Command + Shift + ~, which applies the General format.

Other resource

  • Developer Bryan Braun built a nice interactive tool for building custom number formats

4 15 As A Decimal,

Source: https://exceljet.net/articles/custom-number-formats

Posted by: randolphhavall.blogspot.com

Related Posts

0 Response to "4 15 As A Decimal"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel