Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert [h]:mm sum total format to number format | Excel Worksheet Functions | |||
Number format exactly the same, displays differently in some cells | Excel Discussion (Misc queries) | |||
Number format for Combobox | Excel Discussion (Misc queries) | |||
16 digit number wont keep alteration unless format cell to text | Excel Discussion (Misc queries) | |||
How do i change numbers in text format to number format? | New Users to Excel |