Help

Replace letter by its position in alphabet

Topic Labels: Formulas
Solved
Jump to Solution
941 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Zulmee_POUPARD
4 - Data Explorer
4 - Data Explorer

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

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

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 IFs.

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.

See Solution in Thread

1 Reply 1
kuovonne
18 - Pluto
18 - Pluto

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 IFs.

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.