How do I extract text after the last comma in Excel? 2

How do I extract text after the last comma in Excel?

The process of extracting text after the last comma in Excel involves using a combination of functions and formulas to isolate the text located after the final comma in a cell’s contents. This can be useful for separating data in a single cell into different columns or for extracting specific information from a larger string of text. By utilizing the correct syntax and referencing the appropriate cells, users can easily extract the desired text after the last comma and manipulate it for their desired purposes.

Excel: Extract Text After Last Comma


You can use the following syntax to extract the text after the last comma in a particular cell in Excel:

=TEXTAFTER(A2, ",", -1)

This particular formula extracts the text after the last comma in cell A2.

The following example shows how to use this formula in practice.

Example: Extract Text After Last Comma in Excel

Suppose we have the following dataset in Excel in which column A contains a description of basketball players including their team, position, and classification:

Suppose we would like to extract the text after the last comma in the cells in column A.

We can type the following formula into cell C2 to do so:

=TEXTAFTER(A2, ",", -1)

We can then click and drag this formula down to each remaining cell in column C:

Excel extract text after last comma

Column C now contains the text in column A after the last comma.

For example:

  • The formula extracts Good from Mavs,Guard,Good
  • The formula extracts Great from Mavs,Forward,Great
  • The formula extracts Bad from Mavs,Forward,Bad

And so on.

How This Formula Works

This function uses the following syntax:

TEXTAFTER(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])

where:

  • text: Text to search
  • delimiter: Character or substring to extract text after
  • instance_num (optional): Instance of delimiter after which to extract text (default is 1)
  • match_mode (optional): 0 = case-sensitive (default), 1 = case-insensitive
  • match_end (optional): Treat end of text as delimiter (disabled by default)
  • if_not_found (optional): Value to return if delimiter is not found

Recall that we used the following syntax to extract the text after the last comma in a cell:

=TEXTAFTER(A2, ",", -1)

By using a value of -1 for the instance_num argument, we were able to specify that we wanted to extract the text after the last instance of a comma.

Note: You can find the complete documentation for the TEXTAFTER function in Excel .

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

Cite this article

stats writer (2024). How do I extract text after the last comma in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-extract-text-after-the-last-comma-in-excel/

stats writer. "How do I extract text after the last comma in Excel?." PSYCHOLOGICAL SCALES, 22 Jun. 2024, https://scales.arabpsychology.com/stats/how-do-i-extract-text-after-the-last-comma-in-excel/.

stats writer. "How do I extract text after the last comma in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-extract-text-after-the-last-comma-in-excel/.

stats writer (2024) 'How do I extract text after the last comma in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-extract-text-after-the-last-comma-in-excel/.

[1] stats writer, "How do I extract text after the last comma in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How do I extract text after the last comma in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

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