Skip to content

Instantly share code, notes, and snippets.

@3leftturns
Created July 11, 2014 20:34
Show Gist options
  • Save 3leftturns/3aee61e6f873b0ecba91 to your computer and use it in GitHub Desktop.
Save 3leftturns/3aee61e6f873b0ecba91 to your computer and use it in GitHub Desktop.
Excel return value of second search character in substring
This is the text to search, in cell A1:
Andy Is Awesome
Use the =FIND function to get the index of the first space:
=FIND(<text to search for>, <text to search in>, <index to start at>)
=FIND(" ", A1)
Returns 5
Nesting another find into the formula under the index parameter gives you the second space. Incrementing by 1 in the index field starts the search after the first space.
=FIND(" ",A1,FIND(" ",A1)+1)
Returns 8
This is useful for separating data that has been concatenated together separated by spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment