Count the indent

Etphonehome

New Member
Joined
Apr 9, 2011
Messages
18
Hi,

I have a column of Narratives with indent which shows their hierarchy. Which formula I should use to see how many space that narrative have at the beginning.

E.g.

Finance dept. 0 space Hierarchy 1
Accounting. 2 spaces Hierarchy 2
AR. 4 spaces Hierarchy 3
AP. 4 spaces Hierarchy 3
Internal Control. 2 spaces Hierarchy 2
System. 4 spaces Hierarchy 3

Thanks.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
You could use something like

=LEN(A1)-LEN(TRIM(A1))

But if there are any trailing spaces, or multiple spaces between words you will get an incorrect result.
 
Upvote 0
Thanks jasonb75. But I do have space between words, is there any other formula that can avoid this potential error?
 
Upvote 0
As long as the spaces are only single it will work, i.e. "Finance dept" has only 1 space between the words.
 
Upvote 0

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top