How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data? 2

How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?

The SPLIT function in Google Sheets can be used to retrieve the first item from a cell containing a list of data. This function allows for the extraction of a specific element from a string of data, separated by a delimiter. By specifying the cell containing the data and the delimiter, the SPLIT function will return the first item in the list, allowing for easier data analysis and manipulation. This feature is particularly useful when working with large datasets and needing to extract specific information from cells.

Google Sheets: Use SPLIT Function and Get First Item


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:

Google Sheets SPLIT get first

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.

The following tutorials explain how to perform other common tasks in Google Sheets:

Cite this article

stats writer (2024). How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-split-function-in-google-sheets-to-retrieve-the-first-item-from-a-cell-containing-a-list-of-data/

stats writer. "How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-split-function-in-google-sheets-to-retrieve-the-first-item-from-a-cell-containing-a-list-of-data/.

stats writer. "How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-split-function-in-google-sheets-to-retrieve-the-first-item-from-a-cell-containing-a-list-of-data/.

stats writer (2024) 'How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-split-function-in-google-sheets-to-retrieve-the-first-item-from-a-cell-containing-a-list-of-data/.

[1] stats writer, "How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can I use the SPLIT function in Google Sheets to retrieve the first item from a cell containing a list of data?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top