Forum Discussion
bradpeterson
Jul 21, 2020Copper Contributor
excel function replace all letters in document with numbers automatically
Hello, I'm in need of some help and I cannot find a solution online. I have a document that has uniform sizes. i.e. S, M, L, XL I need to replace those sizes automatically: S=1, M=2, L=3, xl...
mathetes
Jul 21, 2020Silver Contributor
It would be fairly easy to write a formula along the lines below:
=IFS(A1="S",1,A1="M",2,A1="L",3....)
and place such a formula in a cell adjacent to the column with your letter size.
Then you could use Format....Column...Hide to hide the letter-size column, and use only the number.
This would work best if your data are in an official Excel Table. Which leads me to a question or two:
- Where is the data in question coming from?
- How frequently does it change (get updated)?
- What's the process of which this is a part?
- What happens "downstream" with the data, especially this size data?
These are not incidental questions. The truly best way to handle your situation may depend a lot on the bigger picture of which it's a part.