• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Format as number

juwin_pt

New Member
Functions like TEXT, FIXED etc, formats a number to have specific formats, but converts that number into text. Hence they automatically become left aligned eventhough they are numbers. Is there a function to format numbers, and keep them as right aligned. I don't need information that I should click the button to align the numbers to right. I need to do that automatically by formula.


Any ideas?
 
Hi ,


I think partly it is to do with the font you use ; whether it is a variable font or a fixed type font.


I used Courier font , and the following formula :


=TEXT(A1,REPT(" ",CELL("width",A1)-LEN(A1))&"#0")


where A1 contains the number. After entering the formula , and seeing where the cell contents appear , adjust the column width if required. Enter various values and see if they are all right aligned.


Narayan
 
Hi, juwin_pt!

Sorry, maybe my english isn't good enough. No, you can't make cells to be something-aligned from within a formula; I tried to say that you could format the involved cells as right aligned.

Regards!
 
@oldchippy, If I use your formula, all of the values are converted into numbers, but looses the formatting.


@SirJB7, Thats what I also feel. I cannot have a number, formatted to have specific number of decimals, comma etc, and at the same time to be right aligned, from a formula.
 
Hi, juwin_pt!

Did you find a solution or still have the problem? Let us know in order to try to face another approachs.

Upload a file, if it's necessary.

Regards!
 
Back
Top