Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Replace letter by its position in alphabet

Topic Labels: Formulas
Solved
Jump to Solution
286 1
cancel
Showing results for 
Search instead for 
Did you mean: 

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

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

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.