ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   variable number format in cell (https://www.excelbanter.com/excel-discussion-misc-queries/117743-variable-number-format-cell.html)

tina

variable number format in cell
 
Hi
How can i get cell to have 3 decimals places if value below 5 and 2 decimals
if between 5 and 50 and 1 decimal if greater than 50.

I think I know how to do by e a macro but can I use data validation or other
formula
Thanks Tina

Bob Phillips

variable number format in cell
 
Use a custom format of

[<5]0.000;[<=50]0.00;0.0

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"tina" wrote in message
...
Hi
How can i get cell to have 3 decimals places if value below 5 and 2

decimals
if between 5 and 50 and 1 decimal if greater than 50.

I think I know how to do by e a macro but can I use data validation or

other
formula
Thanks Tina




Niek Otten

variable number format in cell
 
Hi Tina,

FormatCellsNumber tab, Custom, in the Type box, enter: [<5]#.000;[<50]#.00;#.0

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"tina" wrote in message ...
| Hi
| How can i get cell to have 3 decimals places if value below 5 and 2 decimals
| if between 5 and 50 and 1 decimal if greater than 50.
|
| I think I know how to do by e a macro but can I use data validation or other
| formula
| Thanks Tina




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

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