The SPLIT function in Google Sheets can be used to divide text based on a specific delimiter.
To get the first item that results from the SPLIT function, you can use the following syntax:
=QUERY(SPLIT(A2, " "), "SELECT Col1")
This particular example will split the text in cell A2 using a space as a delimiter and then it will return only the first item that results from the split.
For example, if the string in cell A2 is Andy Bernard then this formula will return Andy.
The following example shows how to use this formula in practice.
Example: How to Use SPLIT Function and Get First Item in Google Sheets
Suppose we have the following column of names in Google Sheets:
Suppose we would like to split the names based on where a space occurs and then get only the first item that results from the split.
We can type the following formula into cell B2 to do so:
=QUERY(SPLIT(A2, " "), "SELECT Col1")
We can then click and drag this formula down to each remaining cell in column B:
The formula splits the names in column A based on where the space occurs and then only returns the first item from the split.
For this particular example, the first name of each person in column A is returned.
Note that if you’d like to return the second item instead, you can replace Col1 with Col2 in the formula:
=QUERY(SPLIT(A2, " "), "SELECT Col2")
The following screenshot shows how to use this formula in practice:
This time the formula returns the second item from the split.
Feel free to use Col3, Col4, Col5, etc. to instead return the third, fourth, fifth item, etc. from the SPLIT function.
How This Formula Works
Recall the formula that we used to split the text and get the first item from the resulting split:
=QUERY(SPLIT(A2, " "), "SELECT Col1")
Here is how this formula works:
First, the SPLIT function splits the text in cell A2 based on where the space occurs.
For example, the name Andy Bernard is split into one column that contains Andy and a second column that contains Bernard.
Next, the QUERY function selects only the first column from the output.
The end result is that we’re able to get only the first item from the split, which is Andy.
Additional Resources
The following tutorials explain how to perform other common tasks in Google Sheets:
Google Sheets: How to Split Text into Rows
Google Sheets: How to Split Date & Time
Google Sheets: How to Use SPLIT with Multiple Delimiters