FIXED


Returns a number as text with a specified format.

Syntax:

FIXED(number, decimals, omitseparators)

returns text representing number with decimals decimal places. If omitseparators (optional) is TRUE thousands separators will be omitted. In the absence of omitseparators thousands separators are included.


Example:

FIXED(1234567.89, 3)

returns 1,234,567.890 as text, if your locale uses a comma as the thousands separator.

FIXED(1234567.89, 3, TRUE)

returns 1234567.890 as text.


Application:

Financial Reporting


Imagine you are an accountant preparing a quarterly financial report for your company. You have a list of sales figures for different product lines, and these numbers need to be presented consistently in a report. Some of the raw numbers might have many decimal places due to calculations, and you want to ensure they all show exactly two decimal places and use a comma separator for thousands to improve readability.


The FIXED function allows you to do this without changing the underlying numerical value. It simply formats the number as text.


Scenario:

You have the following raw sales data:

Product Line

Raw Sales Figure

A
B
1
Product A
12543.6789
2
Product B
78912.45
3
Product C
5678.9
4
Product D
150000

Your goal is to present this data in a report formatted as follows:

  • Two decimal places for all figures.
  • Comma separator for thousands.


Using the FIXED function:

The syntax for the FIXED function is: FIXED(number, [decimals], [no_commas])

  • number: The number you want to format.
  • decimals: The number of digits you want to display to the right of the decimal point. In this case, we'll use 2.
  • no_commas: An optional logical value. TRUE prevents the function from including commas in the returned text. FALSE (or omitted) includes commas. We will omit this to use the commas.


Let's apply the FIXED function to each raw sales figure.

  • For Product A: FIXED(12543.6789, 2)
  • For Product B: FIXED(78912.45, 2)
  • For Product C: FIXED(5678.9, 2)
  • For Product D: FIXED(150000, 2)


Resulting Table for the Report:

After applying the FIXED function, the formatted text for the report would look like this:

Product Line

Raw Sales Figure

Formatted Sales Figure (as Text)

A
B
C
1
Product A
12543.6789
12,543.68
2
Product B
78912.45
78,912.45
3
Product C
5678.9
5,678.90
4
Product D
150000
150,000.00

Note the key behaviors of the FIXED function demonstrated here:

  1. Rounding: The value for Product A was rounded to two decimal places (from .6789 to .68).
  2. Padding: The value for Product C was padded with a zero to ensure it had two decimal places (from .9 to .90).
  3. Commas: All numbers now have a comma separator for thousands.
  4. Data Type: The output is a text string. This is a crucial point. While it looks like a number, you cannot perform mathematical calculations directly on the output of the FIXED function. If you need to perform calculations, you should always use the original raw number. The FIXED function is purely for presentation and display purposes.




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof