How to right-align text and numbers?

  • Thread starter curiousgeorge408
  • Start date

C

curiousgeorge408

For readability, I have set up the following custom formats, using a
non-proprotional font (Courier New) and right horizontal alignment
with zero indentation:

#,##0" "
"[ "#,##0" ]","[ "-#,##0" ]"

(There are two spaces between quotes, or a combination of one space
and one square bracket.)

Thus, cells with normal numbers line up with numbers enclosed in
square brackets line. That is, the right-most units digit and the
comma separators line up.

Additionally, I want the column titles (dates or text) to line up with
the right-most units digit of the numbers. I tried the following
custom formats:

mmmyy" "
Text" "

The date format works well.

But the text format fails. The text is flush with the right-hand cell
wall instead of being two "Courier spaces" to the left.

I have worked around the problem by using normal Text format and right
horizontal alignment with one indentation instead of zero.

But I don't know if I can count on one indentation being equal to two
"Courier spaces".

(If I can, where is that documented?)

I would prefer to use a custom format that is similar to the others;
that is, something following by two spaces in quotes.

Can someone tell me how to do that?

And if there is a better way to do this altogether, I am open to
different approaches.
 
Ad

Advertisements

F

FSt1

hi
your "text" custom format failed because you cannot appliy custom number
formats to text. you can change the font, size, style but that's it.
as to lineing up, you will just have to eye ball it and hope no one notices.

Regards
FSt1
 
C

curiousgeorge408

your "text" custom format failed because you cannot
appliy custom number formats to text. you can change
the font, size, style but that's it. as to lineing
up, you will just have to eye ball it and hope no one
notices.

Thanks. Speaking of eye-balling, upon closer inspection, I see that
my work-around did not really work. It seemed to line up on the
display, but not on the printed output. Looks like the indented text
is half a character(!) to the right. "Good enough for government
work".

(Although we would miss Mars big time! ;->)

PS: Seriously, as far as eye-balling the text alignment goes, I have
had no success entering spaces on the right of the right-aligned text
with zero indentation. I suspect that Excel always trims text on the
right, which makes some sense, IMHO.
 
Ad

Advertisements

S

ShaneDevenshire

Hi,

Actually you can format the text to push it to the left from the right hand
margin.

The format code would be @" "

However, the actual spacing I leave up to you.

Here is another point to consider. When you right align a cell you can use
the Increase Indent command to indent from the right edge! And you can
control the amount of indent per click by going to Format, Cells, Alignment,
Indent.

If this helps, please click the Yes button.
 

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