ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Changing display of decimal value based on the value in the cell (https://www.excelbanter.com/excel-worksheet-functions/20379-changing-display-decimal-value-based-value-cell.html)

K M

Changing display of decimal value based on the value in the cell
 
If the numeric value in the cell is less than or equal to 5 I would like the
number to be displayed with one decimal value. If in the same cell the value
is 5 I would like the number to be displayed with 0 decimal places. The cell
I am talking about is itself composed of ROUND function.

How can this be done?

Fred Smith

Try:

=if(a15,round(a1,0),round(a1,1))

and format as General.

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"K M" <K wrote in message
...
If the numeric value in the cell is less than or equal to 5 I would like
the
number to be displayed with one decimal value. If in the same cell the
value
is 5 I would like the number to be displayed with 0 decimal places. The
cell
I am talking about is itself composed of ROUND function.

How can this be done?




CLR

Assuming your formula is in A1

=IF(A1<5,ROUND(A1,1),INT(A1))

Vaya con Dios,
Chuck, CABGx3



"K M" <K wrote in message
...
If the numeric value in the cell is less than or equal to 5 I would like

the
number to be displayed with one decimal value. If in the same cell the

value
is 5 I would like the number to be displayed with 0 decimal places. The

cell
I am talking about is itself composed of ROUND function.

How can this be done?




Ragdyer

Try custom format:

[<=5]###.0;[5]###;General

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"K M" <K wrote in message
...
If the numeric value in the cell is less than or equal to 5 I would like

the
number to be displayed with one decimal value. If in the same cell the

value
is 5 I would like the number to be displayed with 0 decimal places. The

cell
I am talking about is itself composed of ROUND function.

How can this be done?




All times are GMT +1. The time now is 06:45 PM.

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