close
I need calculated values to be displayed without any trailing zeros. For
example:
if the result is 12.0, I need it displayed as 12
if the result is 5.50, I need it displayed as 5.5
but... in a worksheet of calculated values, I need the values displayed to
the hundredth's place, as long as there are no trailing zeros, so I can't
just format the cells to one placeholder.

Can this be done? THANX.

I can't figure out how to display an integer without a trailing decimal, but
you can handle the decimal values with a custom format of

0.##
quot;Robinquot; wrote:

gt; I need calculated values to be displayed without any trailing zeros. For
gt; example:
gt; if the result is 12.0, I need it displayed as 12
gt; if the result is 5.50, I need it displayed as 5.5
gt; but... in a worksheet of calculated values, I need the values displayed to
gt; the hundredth's place, as long as there are no trailing zeros, so I can't
gt; just format the cells to one placeholder.
gt;
gt; Can this be done? THANX.

Scratch that last comment -

If all your numbers are integers or have no more than 2 decimal places, just
use the General format. If the numbers potentially exceed to decimal places,
you'll need to ROUND them or TRUNCate them.quot;Robinquot; wrote:

gt; I need calculated values to be displayed without any trailing zeros. For
gt; example:
gt; if the result is 12.0, I need it displayed as 12
gt; if the result is 5.50, I need it displayed as 5.5
gt; but... in a worksheet of calculated values, I need the values displayed to
gt; the hundredth's place, as long as there are no trailing zeros, so I can't
gt; just format the cells to one placeholder.
gt;
gt; Can this be done? THANX.

Robin, (there IS a solution)

Background:
When formatting numeric cells, Excel tries to line up the decimal point, so
all
numbers in a column are more easy to read. Because of this, when you change
cell number formats to show 3-places, you will ALWAYS get ONLY three places.
The numbers with MORE than 3-decimal places will be rounded to the nearest
value, and numbers like 2.5 would show with trailing zeros (as 2.500) so
things
line up nicely.

ANSWER: You wanted to set the number of decimals, but have NO trailing zero.
Don't just set the number of decimal places in the normal fashion...
With your cells selected, goto the format dialogue... (use Ctrl-1 or
Alt_O--gt;E)
then pick the number_tab (on left). Next go to the scrolling set of options
to
the left, and scroll all the way down to the bottom. You will find an
option that
says quot;Customquot;. This will allow you to enter your exact format.

OPTION-#1:
In the format section, enter 0.### (using trailing pound signs)

This will result in UP-TO three decimal places being displayed, but NOT
trailing
zeros... so 36=quot;36.quot; 342.81=quot;342.81quot; and 6.23465=quot;6.235quot;
Note that there is always a decimal, even if the value has no fraction...
I don't know how do format a conditional deciml point.

OPTION-#2:
In the format section, enter 0.??? (using trailing question marks)

This will result in UP-TO three decimal places being displayed, but trailing
spaces
instead of trailing zeros... so 36=quot;36. quot; 342.81=quot;342.81 quot; and
6.23465=quot;6.235quot;
This keeps all numbers lined up nicely, but has no trailing zero displayed.

I hope it helps... (add response amp; feedback, so I'll know you
read it)
Joseph in Atlantaquot;Robinquot; wrote:

gt; I need calculated values to be displayed without any trailing zeros. For
gt; example:
gt; if the result is 12.0, I need it displayed as 12
gt; if the result is 5.50, I need it displayed as 5.5
gt; but... in a worksheet of calculated values, I need the values displayed to
gt; the hundredth's place, as long as there are no trailing zeros, so I can't
gt; just format the cells to one placeholder.
gt;
gt; Can this be done? THANX.


Try this formula where 12.0 is in A1.
=ROUND(A1,2)
This will give 12 or 5.5 where A1 is 5.50.
Or replace A1 in the formula to be the formula you use to calculate the
values, to save having an extra cell and formula. Note that unlike cell
formatting which doesn't change the value but just shows it
differently, this formula can actually reduce the accuracy of the value
by rounding say 5.316454845 to 5.32. Therefore, don't use formulas that
in turn refer to the result of the round formula, unless you just want
it to use 5.32.
To give 100 decimal places (without trailing zeros), change it to
=round(a1,100).
If I haven't understood correctly, please explain further.
CliveRobin Wrote:
gt; I need calculated values to be displayed without any trailing zeros.
gt; For
gt; example:
gt; if the result is 12.0, I need it displayed as 12
gt; if the result is 5.50, I need it displayed as 5.5
gt; but... in a worksheet of calculated values, I need the values displayed
gt; to
gt; the hundredth's place, as long as there are no trailing zeros, so I
gt; can't
gt; just format the cells to one placeholder.
gt;
gt; Can this be done? THANX.--
Clivey_UK
------------------------------------------------------------------------
Clivey_UK's Profile: www.excelforum.com/member.php...oamp;userid=32569
View this thread: www.excelforum.com/showthread...hreadid=524964Option 1 did the trick perfectly! Thank you very much.
Robin

quot;Joseph in Atlantaquot; wrote:

gt; Robin, (there IS a solution)
gt;
gt; Background:
gt; When formatting numeric cells, Excel tries to line up the decimal point, so
gt; all
gt; numbers in a column are more easy to read. Because of this, when you change
gt; cell number formats to show 3-places, you will ALWAYS get ONLY three places.
gt; The numbers with MORE than 3-decimal places will be rounded to the nearest
gt; value, and numbers like 2.5 would show with trailing zeros (as 2.500) so
gt; things
gt; line up nicely.
gt;
gt; ANSWER: You wanted to set the number of decimals, but have NO trailing zero.
gt; Don't just set the number of decimal places in the normal fashion...
gt; With your cells selected, goto the format dialogue... (use Ctrl-1 or
gt; Alt_O--gt;E)
gt; then pick the number_tab (on left). Next go to the scrolling set of options
gt; to
gt; the left, and scroll all the way down to the bottom. You will find an
gt; option that
gt; says quot;Customquot;. This will allow you to enter your exact format.
gt;
gt; OPTION-#1:
gt; In the format section, enter 0.### (using trailing pound signs)
gt;
gt; This will result in UP-TO three decimal places being displayed, but NOT
gt; trailing
gt; zeros... so 36=quot;36.quot; 342.81=quot;342.81quot; and 6.23465=quot;6.235quot;
gt; Note that there is always a decimal, even if the value has no fraction...
gt; I don't know how do format a conditional deciml point.
gt;
gt; OPTION-#2:
gt; In the format section, enter 0.??? (using trailing question marks)
gt;
gt; This will result in UP-TO three decimal places being displayed, but trailing
gt; spaces
gt; instead of trailing zeros... so 36=quot;36. quot; 342.81=quot;342.81 quot; and
gt; 6.23465=quot;6.235quot;
gt; This keeps all numbers lined up nicely, but has no trailing zero displayed.
gt;
gt; I hope it helps... (add response amp; feedback, so I'll know you
gt; read it)
gt; Joseph in Atlanta
gt;
gt;
gt; quot;Robinquot; wrote:
gt;
gt; gt; I need calculated values to be displayed without any trailing zeros. For
gt; gt; example:
gt; gt; if the result is 12.0, I need it displayed as 12
gt; gt; if the result is 5.50, I need it displayed as 5.5
gt; gt; but... in a worksheet of calculated values, I need the values displayed to
gt; gt; the hundredth's place, as long as there are no trailing zeros, so I can't
gt; gt; just format the cells to one placeholder.
gt; gt;
gt; gt; Can this be done? THANX.

arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()