The DOLLAR
function in Excel is used to convert a number to text using currency format, with the specified number of decimal places. This function is useful when you want to display numbers as monetary values in a more readable format.
Syntax
excelDOLLAR(number, [decimals])
- number: The number you want to convert to text.
- decimals (optional): The number of decimal places to include. If omitted, it defaults to 2.
Example
Let's go through an example to understand how the DOLLAR
function works in practice.
Example 1: Basic Usage
Assume you have the following numbers in cells A1, A2, and A3:
- A1: 1234.567
- A2: 987.6543
- A3: 4567.89
You want to convert these numbers to currency format with 2 decimal places.
In cell B1, enter the formula:
excel=DOLLAR(A1, 2)
This will output
$1,234.57
.In cell B2, enter the formula:
excel=DOLLAR(A2, 2)
This will output
$987.65
.In cell B3, enter the formula:
excel=DOLLAR(A3, 2)
This will output
$4,567.89
.
Example 2: Different Decimal Places
Let's use the same numbers but with different decimal places.
In cell C1, enter the formula:
excel=DOLLAR(A1, 1)
This will output
$1,234.6
(rounded to one decimal place).In cell C2, enter the formula:
excel=DOLLAR(A2, 0)
This will output
$988
(rounded to the nearest whole number).In cell C3, enter the formula:
excel=DOLLAR(A3, 3)
This will output
$4,567.890
(with three decimal places).
Notes
- The
DOLLAR
function respects the regional settings of the currency format. So, the currency symbol and the placement of the comma and decimal will depend on your system's locale settings. - The
DOLLAR
function does not change the underlying value of the number; it only changes the way it is displayed as text.
By using the DOLLAR
function, you can ensure that numerical data is presented in a consistent and visually appealing currency format.
No comments:
Post a Comment