My field has a name followed by a number - SAM ADAMS (1234). I need to put the 1234 in it's own field. What is the best way to write a formula to do that?
Page 1 / 1
Try this:
MID({field name}, FIND("(", {field name})+1, LEN({field name})-FIND("(", {field name})-1)
Here is the formula using Regex.
IF(
{Name&Number},
REGEX_EXTRACT(
{Name&Number},
"\\((\\d*)\\)$"
)
)
Actually, I just looked this up — this is the formula you would use to extract numbers from a string of text:
IF(
{text},
REGEX_REPLACE({text}, "\\D", "")
)
Actually, I just looked this up — this is the formula you would use to extract numbers from a string of text:
IF(
{text},
REGEX_REPLACE({text}, "\\D", "")
)
Thanks, Scott. I used an alternative method not the regex function.
Another way of doing this could be to use Airtable's VALUE() function, but that is highly unpredictable since it also performs math! So use that one with caution.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.