ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Displaying decimal places (https://www.excelbanter.com/excel-discussion-misc-queries/137552-displaying-decimal-places.html)

KnowledgeSeeker

Displaying decimal places
 
Is there a way for me to have the data in a cell determine how many
decimal places should be displayed? For example, if the formula in
the cell results in a number that is greater than (or equal to) 10,
then I'd like to have zero (0) decimal places actually displayed.
However, if the formula in the cell results in a number that is less
than 10, I'd like to have zero (0) decimal places displayed.

Thanks for your help.


tim m

Displaying decimal places
 
I don't undersatnd this question, if it is = 10 then zero decimals, if it is
less than 10 zero decimals? Did you type the questuion correctly or am I
seeing things?

"KnowledgeSeeker" wrote:

Is there a way for me to have the data in a cell determine how many
decimal places should be displayed? For example, if the formula in
the cell results in a number that is greater than (or equal to) 10,
then I'd like to have zero (0) decimal places actually displayed.
However, if the formula in the cell results in a number that is less
than 10, I'd like to have zero (0) decimal places displayed.

Thanks for your help.



John

Displaying decimal places
 
have a look at http://peltiertech.com/Excel/NumberFormats.html
--
John
MOS Master Instructor Office 2000, 2002 & 2003
Please reply & rate any replies you get

Ice Hockey rules (especially the Wightlink Raiders)


"KnowledgeSeeker" wrote:

Is there a way for me to have the data in a cell determine how many
decimal places should be displayed? For example, if the formula in
the cell results in a number that is greater than (or equal to) 10,
then I'd like to have zero (0) decimal places actually displayed.
However, if the formula in the cell results in a number that is less
than 10, I'd like to have zero (0) decimal places displayed.

Thanks for your help.



Bernd

Displaying decimal places
 
Hello,

Without VBA you will need a helper cell:
=TEXT(A1,"0"&IF(A1<10,".0",""))

Regards,
Bernd


Harlan Grove[_2_]

Displaying decimal places
 
"Bernd" wrote...
Without VBA you will need a helper cell:
=TEXT(A1,"0"&IF(A1<10,".0",""))


Wrong. Could use the custom number format

[=10]0;[<=-10]-0;0.0



All times are GMT +1. The time now is 01:17 AM.

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