-1

How to get an email from a cell which contains more records?

For example, A1 cell has the following value:

8242663603,"nickname","mail@gmail.com"

I only need an email from this record in cell B1:

mail@gmail.com

and email always comes last

Ruz
  • 15
  • 4

2 Answers2

0

Assuming that the formatting is always the same as your example:

=MID($A1,FIND(""",""",$A1)+3,LEN($A1)-FIND(""",""",$A1)-3)

This selects the text between "," and the end of the text minus 1 character.

Gravitate
  • 2,885
  • 2
  • 21
  • 37
0

Assuming there is always at least 1 " before the emailaddress:

=MID(A1,FIND("~",SUBSTITUTE(A1,"""","~",LEN(A1)-LEN(SUBSTITUTE(A1,"""",""))-1))+1,LEN(A1)-FIND("~",SUBSTITUTE(A1,"""","~",LEN(A1)-LEN(SUBSTITUTE(A1,"""",""))-1))-1)
dreojs16
  • 109
  • 12
  • Why have you added all the `SUBSTITUTE` functions? Other than that, it appears to be identical to my answer. What benefit does this offer over my, shorter solution? – Gravitate Nov 12 '19 at 14:24
  • @Gravitate This way the text before the emailaddress and its formatting is of no importance, as long as it contains at least 1 ". In your solution the formatting should always follow the same pattern with _something_ **,"** _something_ **","**_something_ – dreojs16 Nov 18 '19 at 12:37
  • Hmm. I see but I partially disagree. As long as `","` appears immediately before the email address, the pattern doesn't matter. Your answer still requires that the email address is in the last position (the same as mine does). The only difference I can see is that yours still works if `","` appears earlier in the string, where as mine would break. BUT if a `~` appeared in the string, that would break yours, where as mine would still work. – Gravitate Nov 19 '19 at 09:24