• 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.

Formula to convert cell value based on # of digits

mpolo954

New Member
Hi,
I have data that was exported from Solidworks to Excel (csv), which includes hierarchical levels in a format I would like to change in the least painful way possible. If I have a column of data in this format 1, 1.1, 1.1.1, 2, 2.1, 3, 3.1, 3.1.1, 3.2, 3.2.1 (where the , represents a new cell), how can I convert to this format 1, 2, 3, 1, 2, 1, 2, 3, 2, 3?
Where single digit = 1, two digits = 2, three digits =3, and so on. (1, 2, or 3 would convert to 1) (1.1, 2.1, or 2.2 would convert to 2) (1.1.1, 3.1.1, or 3.2.1 would convert to 3)
I guess digit in not the correct wording because 10.10.20 would = 3

Any help would be greatly appreciated!
 

Attachments

  • Hiearchical Levels Testing.xlsx
    11.5 KB · Views: 10
mpolo954
I'm sure that You have read Forum Rules
Do You remember (if not - please reread)
that in How to get the Best Results at Chandoo.org-part
has a sentence
For the best/fastest results, Upload a Sample File...?
 
mpolo954
I'm sure that You have read Forum Rules
Do You remember (if not - please reread)
that in How to get the Best Results at Chandoo.org-part
has a sentence
For the best/fastest results, Upload a Sample File...?
Thank you for the tip!
 
mpolo954, Good afternoon.

Greetings vletm colleague.

Maybe a simple formula can solve your question.

Try to use: =(LEN(A2)-LEN(SUBSTITUTE(A2;".";"")))+1

I hope it helps.
 

Attachments

  • Hiearchical Levels Testing-OK.xlsx
    14 KB · Views: 7
Back
Top