ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numeric formatting: decimals and no decimals (https://www.excelbanter.com/excel-programming/393326-numeric-formatting-decimals-no-decimals.html)

ppsa

Numeric formatting: decimals and no decimals
 
Hi,

Can anyone please tell me how to format numbers so that if there is no
decimal value a whole number without decimals shows up, but if there is a
decimal value then a number with 1 or 2 decimal values show up? Like this:

1
0
0.2
2.3

Thank you.

Jim Thomlinson

Numeric formatting: decimals and no decimals
 
Have you tried formating as general?
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Hi,

Can anyone please tell me how to format numbers so that if there is no
decimal value a whole number without decimals shows up, but if there is a
decimal value then a number with 1 or 2 decimal values show up? Like this:

1
0
0.2
2.3

Thank you.


ppsa

Numeric formatting: decimals and no decimals
 
Yeah, it almost does the trick, but I'd like to get rid of the zero to the
left of the decimal (my example below mistakenly includes the zero).

"Jim Thomlinson" wrote:

Have you tried formating as general?
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Hi,

Can anyone please tell me how to format numbers so that if there is no
decimal value a whole number without decimals shows up, but if there is a
decimal value then a number with 1 or 2 decimal values show up? Like this:

1
0
0.2
2.3

Thank you.


Jim Thomlinson

Numeric formatting: decimals and no decimals
 
Try
Tools - Options - View - Uncheck Zero Values
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Yeah, it almost does the trick, but I'd like to get rid of the zero to the
left of the decimal (my example below mistakenly includes the zero).

"Jim Thomlinson" wrote:

Have you tried formating as general?
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Hi,

Can anyone please tell me how to format numbers so that if there is no
decimal value a whole number without decimals shows up, but if there is a
decimal value then a number with 1 or 2 decimal values show up? Like this:

1
0
0.2
2.3

Thank you.


Steve Dalton

Numeric formatting: decimals and no decimals
 
How about conditional formatting?

"Jim Thomlinson" wrote in message
...
Try
Tools - Options - View - Uncheck Zero Values
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Yeah, it almost does the trick, but I'd like to get rid of the zero to
the
left of the decimal (my example below mistakenly includes the zero).

"Jim Thomlinson" wrote:

Have you tried formating as general?
--
HTH...

Jim Thomlinson


"ppsa" wrote:

Hi,

Can anyone please tell me how to format numbers so that if there is
no
decimal value a whole number without decimals shows up, but if there
is a
decimal value then a number with 1 or 2 decimal values show up? Like
this:

1
0
0.2
2.3

Thank you.





All times are GMT +1. The time now is 03:45 AM.

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