Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I export data from an application to Excel sheets.

The first column of the exported data (Column A) has some information, but contains text like 16.1 or 16.1.1, etc. I need to create a column right next to it, containing the "level", which is calculated by the number of dots.

For example, for 16.1.1 the level is 2, or for 16.1.3.4 the level is 3.

share|improve this question

1 Answer 1

You can use the following formula to count the . in the cell.

=LEN(A1)-LEN(SUBSTITUTE(A1,".",""))

Copy the formula to the rest of the cells in the column to get result for each row.

enter image description here

share|improve this answer
    
+1 Clever solution! –  Excellll Jul 26 '12 at 15:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.