• 100% Satisfaction Guarantee

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience:  Bachelor of Science - Engineering Consultant
53785
Type Your Microsoft Office Question Here...
John D is online now

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

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:

12345
1234
123
12
1

Hi again,

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

Customer: replied 4 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 4 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.

Thus,

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.

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 4 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:

if

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

Correct?

V123 --> ???

V1234 --> ???

V12345 --> ???

Customer: replied 4 years ago.

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

http://www.filesharesite.com/files/201209/1346961670DG_LD_FINAL_1.xlsx

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

Customer: replied 4 years ago.

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

Thanks

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 4 years ago.

so,

there are no 1s

there are no 12s

123 -->123.0

0123-->012.3

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)

Customer: replied 4 years ago.

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

http://www.filesharesite.com/files/201209/1347031882DG_LD_FINAL_NEW1.xlsx

Customer: replied 4 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