number format - align decimal point but not minus sign

Y

yair

hi (1st time here)

i wish to align all decimal points in a table column containin
numbers, and center the number with highest number of digits. what i d
is i format the number as:

?,???,???

(that's for example - if the largest number in that column i
1,234,567)

the problem is with negative numbers - the minus sign appears far fro
the number, in small numbers. in the previous example, i could get:

- 1,234

(instead of -1,234)

hope i'm clear
and thanks
yai
 
R

Ron Rosenfeld

hi (1st time here)

i wish to align all decimal points in a table column containing
numbers, and center the number with highest number of digits. what i do
is i format the number as:

?,???,???

(that's for example - if the largest number in that column is
1,234,567)

the problem is with negative numbers - the minus sign appears far from
the number, in small numbers. in the previous example, i could get:

- 1,234


Format something like:

#,##0.0000

where the number of 0's after the decimal is equal to or greater than the
largest number of decimals you wish to display.

That will line up the decimals and give you the minus sign near the number
(provided you keep the default left alignment)

Centering the largest number is more difficult. I don't know how to do it
automatically without using VBA, but two manual methods would include:

1. Resize the column after you do the formatting, so the number with
the highest number of digits just fits.

2. Add spaces to the end of the above cell format so that the number
of digits + spaces after the decimal is equal to the same prior to the decimal
The former you would have to obtain by examining your data. Of course, this
method will only work with a fixed pitch font.




--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top