ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Whole Number and Decimals (https://www.excelbanter.com/excel-discussion-misc-queries/133781-whole-number-decimals.html)

Charles Knight

Whole Number and Decimals
 
Is there a way to limit the deicmal formatting to only non-whole numbers.
Example: 5 would show as 5 instead of 5.000 while 5.245 would still show
correctly.

The cell I am working with is a calcuted one (=sum(a1*b1)) so the number is
sometimes requires a decimal and sometimes not. Any help or suggestions would
be greatly appreciated.

T. Valko

Whole Number and Decimals
 
Try this:

Format the cell as GENERAL

=IF(MOD(A1*B1,1),ROUND(A1*B1,3),A1*B1)

Biff

"Charles Knight" <Charles wrote in message
...
Is there a way to limit the deicmal formatting to only non-whole numbers.
Example: 5 would show as 5 instead of 5.000 while 5.245 would still show
correctly.

The cell I am working with is a calcuted one (=sum(a1*b1)) so the number
is
sometimes requires a decimal and sometimes not. Any help or suggestions
would
be greatly appreciated.




Sandy Mann

Whole Number and Decimals
 
A cell format of General will give you that. General is the default format.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Charles Knight" <Charles
wrote in message
...
Is there a way to limit the deicmal formatting to only non-whole numbers.
Example: 5 would show as 5 instead of 5.000 while 5.245 would still show
correctly.

The cell I am working with is a calcuted one (=sum(a1*b1)) so the number
is
sometimes requires a decimal and sometimes not. Any help or suggestions
would
be greatly appreciated.




bigwheel

Whole Number and Decimals
 
This is the default for Excel. If you are getting something else try
formatting the cell to General. I can't quite figure out what purpose the
SUM funtion is doing in your example because =A1*B1 will give the same result.

"Charles Knight" wrote:

Is there a way to limit the deicmal formatting to only non-whole numbers.
Example: 5 would show as 5 instead of 5.000 while 5.245 would still show
correctly.

The cell I am working with is a calcuted one (=sum(a1*b1)) so the number is
sometimes requires a decimal and sometimes not. Any help or suggestions would
be greatly appreciated.


driller

Whole Number and Decimals
 
Hi Charles Knight,

I have seen your reason that you need to display in the sum cell the actual
un-rounded value on the last decimal...the sheets standard column width
suppress the value...unless you double click the header's column right
edge...

Excluding the limited of number of digits....

I suggest that you format your sum cell in formatcellsnumbercustom
type #,###.###########
the bargain here is that if the sum result is a whole number,
e.g. "5" the displayed value will be "5."

i hope i made it clear only to help you.

regards,
driller
--
*****
birds of the same feather flock together..



"Charles Knight" wrote:

Is there a way to limit the deicmal formatting to only non-whole numbers.
Example: 5 would show as 5 instead of 5.000 while 5.245 would still show
correctly.

The cell I am working with is a calcuted one (=sum(a1*b1)) so the number is
sometimes requires a decimal and sometimes not. Any help or suggestions would
be greatly appreciated.



All times are GMT +1. The time now is 12:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com