How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask John D Your Own Question
John D
John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience:  Bachelor of Science - Engineering Consultant
Type Your Microsoft Office Question Here...
John D is online now
A new question is answered every 9 seconds

I need to figure out how these numbers would be if right justified

This answer was rated:

I need to figure out how these numbers would be if right justified or left justified. Please help me do it but also explain the logic. Also these numbers need to be at least three digits, max 5. If not, should they have leading or ending zeroes based on the justification.

The numbers, as an example, are:


Hi again,


Is this related to the same issue that we were working on or is it something else?



Customer: replied 5 years ago.

actually, yes. I need the answer to this to post the question you asked. I am trying to figure out where the decimal goes with these other codes.

Ok could you show me the desired result for each of these numbers so I can understand how you want them formatted and up the formula or macro to replicate the results



Customer: replied 5 years ago.

i am not sure about your question. you see my problem is: the data i have is just 2-5 numbers. they actually represent diagnostic ICD-9 codes. These codes have decimals, but the data I have does not have that. I know there is a logic based on whether the data has been right justified or left justified. But i can't get that information. So I am trying to figure it out.



12345 could be either 123.45 or 12.345

1234 could be 12.34 or 123.40

123 could be 12.3 or 123.0

12 gets one leading zero first so 012 which could either be 01.2 or 012.0


however, to determine this, i need to know if they used left or right justification.


if i could figure that out, i will know where the decimal goes.

Ok let's start with right and left justified numbers.


If the numbers are entered as 'text' excel automatically left justifies the number. If it is entered as numbers Excel right justifies the number


Now are they entered, as text or as numbers?



If you can send me the file I will be able to tell



Customer: replied 5 years ago.

ok, i went back to the code books and came up with some answers that should be of help.


It is left-justified.


So in the file that I linked in the other question you will see numbers that are left-justiifed so that:




12345---> it should be 123.45

1234--> ..........123.4

three and 2 digit numbers can be ignored because they are invalid



Also, letters are included in the justification so:

V0451 will be V04.51

V567 will be V56.7

Ok so


1 --> ignore

12 --> ignore

123 --> ignore

more than 3 digits --> place decimal after 3rd digit




What about the code that has a leading character, e.g.


V123 --> ???

V1234 --> ???

V12345 --> ???



Customer: replied 5 years ago.

please read my edit reply prior, but you are right....

I see.


So the letter is counted as a digit, and the decimal will still be placed after the 3rd digit


Ok I will start on it shortly and get back to you as soon as I'm done




Ok here you go


I combined the two formula columns into a single column. Final formulas and results are in column B.


All results are left justified


Let me know if it needs any tweaking


Will now start on the other file as soon as I finish the job on hand





John D and 3 other Microsoft Office Specialists are ready to help you
Customer: replied 5 years ago.

Sorry, just a slight tweak. Please incorporate three digits again (we previously ignored them).



So you first add enough 0's to make the code at least 4 digits long, then place the decimal after the 3rd, as such:


1 --> 0001 --> 000.1.

12 --> 0012 --> 001.2

123 --> 0123 --> 012.3

1234 --> 123.4

12345 --> 123.45


Please correct as necessary and send back






Customer: replied 5 years ago.

no. the zeroes have already been added...




there are no 1s

there are no 12s

123 -->123.0


1234 --> 123.4

12345 --> 123.45

Ok then please send me the file where the 0's have been added so I can set up the formulas on it (the file that I have does not have any added 0's)





Ok here are the new formulas meeting the last requirement. Please check it and let me know



Customer: replied 5 years ago.

Can you respond to my previous question on the trailing/leading zeroes....I haven't gotten any responses yet....

I have indeed responded at 10:30 AM (pacific). Here is the link