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 ExchangeI'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.