Sep 27, 2021 03:27 PM
Hi, I need to convert letters to their position in the alphabet. So A becomes 1, B → 2, C → 3 etc…
Does Airtable have a function to do that?
I’d like to avoid the multiple IF statements :upside_down_face:
Thank you
Solved! Go to Solution.
Sep 27, 2021 06:14 PM
Welcome to the Airtable community!
No, Airtable does not have a built in function that converts a letter to a number. If you know that the field will have only a single letter, you can use a SWITCH
statement instead of nested IF
s.
SWITCH( {field name},
"A", 1,
"B", 2,
"C", 3,
...
"Z", 26
)
If your field will have multiple letters, you can use 26 nested SUBSTITUTE()
functions. Note that the result will be a string that looks like a number, but not an actual number unless you wrap a VALUE()
function around it.
Sep 27, 2021 06:14 PM
Welcome to the Airtable community!
No, Airtable does not have a built in function that converts a letter to a number. If you know that the field will have only a single letter, you can use a SWITCH
statement instead of nested IF
s.
SWITCH( {field name},
"A", 1,
"B", 2,
"C", 3,
...
"Z", 26
)
If your field will have multiple letters, you can use 26 nested SUBSTITUTE()
functions. Note that the result will be a string that looks like a number, but not an actual number unless you wrap a VALUE()
function around it.