#1   Report Post  
Posted to microsoft.public.excel.misc
Mark Olsen
 
Posts: n/a
Default Number format

Could someone tell me if this is possible and how to do it if it is in using
the custom number formats in Excel. I want to have thousands separators in
my number. I know how to add this but my problem is that if there is no
decimal part of the number then I dont want the decimal point to appear. If
there is a decimal part then I want the decimal point involved. It would be
even better if I could have it do 2 digits of precision if there is a decimal
part but that is not totally necessary.

For Example

8300
8300.25
8300.20
754

Thanks,

Mark
  #2   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Number format

Mark,
This cannot be done with a single format. An example using a
formula is:

Number in A1, formula in B1

=IF(MOD(A1,1)=0,TEXT(A1,"#,###"),TEXT(A1,"#,###.00 "))

You probably want the VBA equivalent which could be initiated with a
Worksheet event i.e entry in column A triggers code to set "numberformat" of
cell.

HTH

"Mark Olsen" wrote:

Could someone tell me if this is possible and how to do it if it is in using
the custom number formats in Excel. I want to have thousands separators in
my number. I know how to add this but my problem is that if there is no
decimal part of the number then I dont want the decimal point to appear. If
there is a decimal part then I want the decimal point involved. It would be
even better if I could have it do 2 digits of precision if there is a decimal
part but that is not totally necessary.

For Example

8300
8300.25
8300.20
754

Thanks,

Mark

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
Convert [h]:mm sum total format to number format Guy Excel Worksheet Functions 1 August 5th 05 05:56 AM
Number format exactly the same, displays differently in some cells eider Excel Discussion (Misc queries) 1 July 29th 05 12:26 AM
Number format for Combobox MBlake Excel Discussion (Misc queries) 1 June 29th 05 03:25 AM
16 digit number wont keep alteration unless format cell to text Croc001 Excel Discussion (Misc queries) 3 March 30th 05 09:12 AM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM


All times are GMT +1. The time now is 01:23 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"