Formula to Extract letters only from String

Topic Labels: Formulas
Solved
3591 6
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

I have afield with inventory numbers. There numbers start with a bin letter designator and then a number. ex, A2, G22, AA15, AB21

I was using the LEFT function to grab the First character to identify the bin letter, but now that I have grown and now have bins AA, AG, etc. How to I have have Airtable grab just the letters out of the field or grab two letters is the inventory has one?

Thanks,

1 Solution

Accepted Solutions
10 - Mercury

Thanks @Bill.French - very kind but actually I misread the question! Although of course your suggestion that this allow you to find the length is clearly the way forward.

However, there is one issue and that is that the LEN() function doesn’t work on a number - so you need to convert the VALUE(Bin) (I’ve used a field called Bin for the whole Inventory Number) to a string by adding a Zero length string ("") to it. The formula then ends up as:

Turn’s out it wasn’t so obvious but hopefully this should be the answer.

6 Replies 6
10 - Mercury

The simplest way to do this is to use the VALUE() function which will extract the numeeric part from the inventory number.

Hope this helps…

5 - Automation Enthusiast

How can I use this to extract the BIN Letter?

17 - Neptune

I think what @Julian_Kirkness is intimating is that using Value() to know the numbers in the string, you are now in a position to know the length of the number portion as well as the length of the entire string and by deduction, the length of the letters portion.

You see where this is going? :winking_face:

10 - Mercury

Thanks @Bill.French - very kind but actually I misread the question! Although of course your suggestion that this allow you to find the length is clearly the way forward.

However, there is one issue and that is that the LEN() function doesn’t work on a number - so you need to convert the VALUE(Bin) (I’ve used a field called Bin for the whole Inventory Number) to a string by adding a Zero length string ("") to it. The formula then ends up as:

Turn’s out it wasn’t so obvious but hopefully this should be the answer.

5 - Automation Enthusiast

Perfect, thank you very much

17 - Neptune

As a Javascript nerd with vast hubris, I just assumed that everyone knew I meant .toString().length(). :winking_face: