Excel number format to only show decimals when necessary

后端 未结 6 1214
旧巷少年郎
旧巷少年郎 2021-01-12 00:32

How can I, without using formulas, show integers as integers, but decimals limited to a specific number of decimal places.

e.g. show: 1 as 1

6条回答
  •  甜味超标
    2021-01-12 00:52

    Us if and text formula to format your values. If your values are in column A, use this formula:

    =IF(LEN(A1)=1,TEXT(A1,"0"),TEXT(A1,"0.00"))
    

    This formula basically says if length of cell value is 1, then return formatted value as "0", otherwise return value as "0.00".

提交回复
热议问题