Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there anything in a custom formatted formula which defines the text alignment?

I know the different parts of the formula is numbers, negative numbers and so on, but I need to set the alignment.


_*# ##0_;_*(# ##0)_;_*"-"??_;_@_
share|improve this question
you want it aligned how? the custom format you show above is close or far from what you want? – datatoo Feb 9 '13 at 1:08
up vote 5 down vote accepted

While it is not possible to explicitly set the cell alignment using a custom format, you can achieve the same effect using the Repeat Characters syntax in the custom format. This syntax is simply the * character followed by the character that you want to repeat, in this case presumably the space character.

For example, the simple comma-separated number format "#,##0" can be made to align left by changing the format string to "#,##0* ".

Taking the example further, you could have number entries align left and text entries align right using the custom format string "#,##0* ;;;* @".

share|improve this answer

Alignment cannot be set in a number formatting string. By default, numbers are right-aligned and text is left-aligned. To change these, you need to use the alignment commands, either on the toolbar/ribbon or on the alignment tab of the format dialog.

share|improve this answer

Not exactly. I have to agree with @teylyn but you can do something that you might be able to adapt.

enter image description here

share|improve this answer

The asterisk in the number format code represents the repeating character modifier. It is used along with a character to display a repeating digit that fills the empty space in a cell. If you think alignment cannot be set in an Excel custom numer format, then you should try a date format like "D __ MMMM * DDDD", aligning day numer and name and name of month to the left, name of weekday to the right. Further columns may be required to add more formats, such as aligning double digit day number to the right.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .