ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Two digit number with one decimal, or three digit number (https://www.excelbanter.com/excel-worksheet-functions/259396-two-digit-number-one-decimal-three-digit-number.html)

Cass1930

Two digit number with one decimal, or three digit number
 
I would like to have one decimal point in a number, unless the number is 100
in order to fit the columns in a table. So, three digits for whatever number
I type in, and if it is two digits, to have a decimal.

95.6
45.2
80.0
100 - NOT 100.0
123 - NOT 123.0

Thanks!

Teethless mama

Two digit number with one decimal, or three digit number
 
Custom Format:

[<100]0.0;0


"Cass1930" wrote:

I would like to have one decimal point in a number, unless the number is 100
in order to fit the columns in a table. So, three digits for whatever number
I type in, and if it is two digits, to have a decimal.

95.6
45.2
80.0
100 - NOT 100.0
123 - NOT 123.0

Thanks!


Brad E.

Two digit number with one decimal, or three digit number
 
From the Format Cells window, on the Number tab, select Custom. In the Type
box enter
[<100]0.0;0
This says for anything less than 100 display at least one character for the
whole number and exactly one decimal character; otherwise, display the whole
number.

-- Brad E.


"Cass1930" wrote:

I would like to have one decimal point in a number, unless the number is 100
in order to fit the columns in a table. So, three digits for whatever number
I type in, and if it is two digits, to have a decimal.

95.6
45.2
80.0
100 - NOT 100.0
123 - NOT 123.0

Thanks!



All times are GMT +1. The time now is 09:53 AM.

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