If you want to change all spaces for underscores use:
=SUBSTITUTE(C8," ","_")
To remove multiple spaces at the start or end of your string, use:
=SUBSTITUTE(TRIM(C8)," ","_")
Answer from cybernetic.nomad on Stack ExchangeNeed excel formula to insert underscore before the Proper case letter where ever find it in a string.
vba - "_" underscore in Excel Formula - Stack Overflow
How to format a character ("_") in a cell value.
excel - Trying understand what underscore means - Stack Overflow
I'm trying to make a dependent drop down list from a main list that is something like:
-
1A
-
1B
-
2A
-
2M
-
XYZ
-
Alpha
-
7
-
13
-
21
I see that the named ranges that begin with numbers adds an underscore as the first character and that's screwing up my =INDIRECT() equation for the range of the dependent list. (It's working fine if I use a subset of just XYZ and Alpha)
How so I tell Excel to add a leading underscore? Everything I can google it talking about substituting an underscore in between things, and not adding a leading one.