2

I have a string that contains one or more email addresses, for example:

[email protected], [email protected]

I want to select just the first email address, which is doable with something like

LEFT(EmailString(FIND(",",EmailString,1)-1)

That formula searches for a comma, but what do I do when there is only one value and no comma? If the email is simply [email protected] then that formula throws an error on the find. Is there a better formula?

1 Answer 1

3

You can incorporate the IF and CONTAINS functions here:

IF(
    NOT(CONTAINS(EmailString, ',')),
    EmailString, /*your existing formula here*/
)

Basically, if there is no comma, just use the value, otherwise use the formula you already have.

1
  • OP could also append a comma to EmailString and use orig formula
    – cropredy
    Commented Jul 19, 2017 at 5:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .