Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to format <10, show 1 decimal....

I would like to format a number if <10, to show 1 decimal place, if =10, no
decimal place and with red colour for negative numbers.

e.g.
1.24 to show as 1.2 (numbers in black)
10.6 to show as 11 (numbers in black)
-2.63 to show as 2.6 (numbers should be in red to denote negative)

I am trying to avoid using functions in the cells itself.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to format <10, show 1 decimal....

On Mon, 5 May 2008 02:50:01 -0700, jazzii
wrote:

I would like to format a number if <10, to show 1 decimal place, if =10, no
decimal place and with red colour for negative numbers.

e.g.
1.24 to show as 1.2 (numbers in black)
10.6 to show as 11 (numbers in black)
-2.63 to show as 2.6 (numbers should be in red to denote negative)

I am trying to avoid using functions in the cells itself.



If you can limit yourself to three conditions, right click on the cell and
select Format Cells.

Number/Custom Type:

[Red][<0]0.0;[<10]0.0;0

That would give all values less than zero as one decimal with a Red color.

If you need to have numbers less than <=-10 have no decimals, and you don't
want a formula in the cell itself, you'll need to use a VBA event triggered
macro to change the formatting.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to format <10, show 1 decimal....

Hi, thanks for the info. I will need the forth condition as well, i.e. if
-10.1, show as 10 in Red.

However, I do not know VBA. If there is another other method, please share
thanks!!

"Ron Rosenfeld" wrote:

On Mon, 5 May 2008 02:50:01 -0700, jazzii
wrote:

I would like to format a number if <10, to show 1 decimal place, if =10, no
decimal place and with red colour for negative numbers.

e.g.
1.24 to show as 1.2 (numbers in black)
10.6 to show as 11 (numbers in black)
-2.63 to show as 2.6 (numbers should be in red to denote negative)

I am trying to avoid using functions in the cells itself.



If you can limit yourself to three conditions, right click on the cell and
select Format Cells.

Number/Custom Type:

[Red][<0]0.0;[<10]0.0;0

That would give all values less than zero as one decimal with a Red color.

If you need to have numbers less than <=-10 have no decimals, and you don't
want a formula in the cell itself, you'll need to use a VBA event triggered
macro to change the formatting.
--ron

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How to format <10, show 1 decimal....

On Mon, 5 May 2008 08:44:03 -0700, jazzii
wrote:

Hi, thanks for the info. I will need the forth condition as well, i.e. if
-10.1, show as 10 in Red.

However, I do not know VBA. If there is another other method, please share
thanks!!


You could use a formula to round numbers appropriately, and then format to RED
or not depending on if the result is ABS(10).

Do you have formulas in the cells?

If not, you will have to separate your data entry from your display.
--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding time in 24 hour format to produce hours in decimal format Hercdriver Excel Worksheet Functions 11 December 29th 09 02:06 AM
Show decimal as percent Gizmo Excel Discussion (Misc queries) 3 April 16th 08 01:54 AM
conditional format of number? -- show decimal ONLY IF not 0 projectx633 Excel Discussion (Misc queries) 1 January 9th 07 02:38 PM
Custom Format - show as decimal Heidi Excel Discussion (Misc queries) 4 June 30th 06 06:57 PM
How Show decimal in Bar Function Babba Excel Worksheet Functions 1 September 9th 05 03:36 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"