If you want to extract a name from a cell, you might think of using LEFT, RIGHT, MID. But this case is different: we need to search through many unstructured cells and return "John" if John is found, "Mary" if Mary is found. Do LEFT, RIGHT, MID still apply?
Extract names from unstructured content
=IF(ISNUMBER(FIND("John",B2)),"John",IF(ISNUMBER(FIND("Mary",B2)),"Mary","Others"))
C2:=IF(ISNUMBER(FIND(“John”,B2)),”John”,IF(ISNUMBER(FIND(“Mary”,B2)),”Mary”,”Others”))
- Start by explaining FIND: FIND("John",B2) searches B2 for "John"; if found it returns the position of "John" in B2 (e.g. 1 if "John" starts at the first character). Otherwise, FIND returns an Error.
- =ISNUMBER(FIND("John",B2)) checks whether FIND returns a number. If yes, TRUE; otherwise FALSE. So it verifies whether B2 contains "John".
- =IF(ISNUMBER(FIND("John",B2)),"John",...) means if B2 contains "John" return "John", otherwise use the same method to check for "Mary" (i.e., a nested IF).









