Custom Number Format problem

  • Thread starter Thread starter RiTz21
  • Start date Start date
R

RiTz21

I need a special number format, but I can't seem to get what I want:

IF a number is an integer, then there should be NO decimal point
displayed.
IF a number has a decimal part, then if should display only one digit
for it.

For instance:

3 -> 3
4.34 -> 4.3
2.88 -> 2.9
34 -> 34
5.01 -> 5.0

Is it possible to do this with a custom number format ?

THANKS !

R
P.S. I would prefer NOT to use any VBA to do this!
 
Maybe.

But easier would be:

=IF(MOD(A1,1)=0,INT(A1),ROUND(A1,1))

and format as General

Of course you can replace A1 with your original formula, but then it is calculated twice

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


|I need a special number format, but I can't seem to get what I want:
|
| IF a number is an integer, then there should be NO decimal point
| displayed.
| IF a number has a decimal part, then if should display only one digit
| for it.
|
| For instance:
|
| 3 -> 3
| 4.34 -> 4.3
| 2.88 -> 2.9
| 34 -> 34
| 5.01 -> 5.0
|
| Is it possible to do this with a custom number format ?
|
| THANKS !
|
| R
| P.S. I would prefer NOT to use any VBA to do this!
|
 
Alas, this is for a cell where the user 'inputs' numbers... so I cannot
have a formula in that cell!! I seek a way using the Custom Format, if
it is doable...

Thanks !
R
 
Back
Top