'How do I create full path given index level and corresponding folder name?
In Excel, I have index levels (1, 1.1, 1.2, 1.2.1, 2, etc.) and corresponding folder name. I want a function to be take each level and concatenate corresponding folder names with a slash between levels (as to mimic a file path).
I don't know whether number of levels matters, but my full dataset has 6 levels (1.3.3.2.6.1). Hyperlinked here shows what I'm hoping to achieve.
Edit: see how 10 takes 1 / 10 after function applied, same with 20's, 30's, etc. | Index | End of Path | Function Applied | | ----- | ----------- | ---------------- | | 1 | Corporate Matters | Corporate Matters | | 9.5 | Network and phones | Network and phones | | 10 | Environmental, Health, & Safety | Corporate Matters/Environmental, Health, & Safety | | 10.1 | Environmental site assessments (Phase I or Phase II reports) | Corporate Matters/Environmental, Health, & Safety/Environmental site assessments (Phase I or Phase II reports) |
Solution 1:[1]
Assuming that:
- Your index level column is always ordered, as per your example
- You have Office 365
- Your data is in
A1:B10
in C1
:
=TEXTJOIN("/",,FILTER(B$1:B$10,LEFT(A$1:A$10,LEN(A$1:A$10))=LEFT(A1,LEN(A$1:A$10))))
and copied down.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jos Woolley |