ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I center numbers in a cell, but align by decimal? (https://www.excelbanter.com/excel-discussion-misc-queries/218240-how-do-i-center-numbers-cell-but-align-decimal.html)

Juliue

How do I center numbers in a cell, but align by decimal?
 
I would like to keep numbers near the center of a long cell, but align the
numbers by decimal. Is this possible?

Thank you!
Julie

Shane Devenshire[_2_]

How do I center numbers in a cell, but align by decimal?
 
Yes it is possible.

1. Format the cells to the same number of decimal places.
2. Click the Increase Indent button
3. Click the Right align button
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Juliue" wrote:

I would like to keep numbers near the center of a long cell, but align the
numbers by decimal. Is this possible?

Thank you!
Julie


MyVeryOwnSelf[_2_]

How do I center numbers in a cell, but align by decimal?
 
I would like to keep numbers near the center of a long cell, but align
the numbers by decimal. Is this possible?


There's probably a better way, but here's one that seems to work.

If there are at most three decimal places, use a helper column with this
formula:
=TEXT(A1,
IF(MOD(A1,1)=0,"#. ",
IF(MOD(10*A1,1)=0,"#.# ",
IF(MOD(100*A1,1)=0,"#.## ",
"#.###"))))
Use Courier font, or another having fixed-width characters.

For more or fewer decimal places, modify accordingly.

To adjust the horizontal placement in the cells, use
Format Cells Alignment Horizontal Left indent
and set the "indent" parameter to taste.

(I have Excel 2003.)


All times are GMT +1. The time now is 04:23 PM.

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