Function Problems

Find the First or Last Alphabetical Text Value in Excel

Jason MillerJason Miller Nov 14, 2026 869 views

Question details

Find the first or last nonblank text value alphabetically in a range without manually sorting the column.

Find the First or Last Alphabetical Text Value in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants a formula that returns an alphabetical endpoint from a column of text.
Observed behavior
The desired result is the first or last text value in alphabetical order, excluding blank cells.
Before you start

Identify the range to search, such as A10:A999, and choose an empty cell for the result. The SORT and FILTER formulas below require an Excel version that supports dynamic arrays.

Solution 1Recommended

Use FILTER and SORT to find the first or last text value

Use this method in Excel versions with dynamic arrays to return an alphabetical value without changing the source column.

FILTER keeps nonblank text values, while SORT orders the filtered results inside the formula. INDEX returns the first item from that ordered list.

1
Enter the first-value formula

Select an empty cell and enter =IFERROR(INDEX(SORT(FILTER(A10:A999,ISTEXT(A10:A999)*(A10:A999<>"")),1,1),1),""). Replace A10:A999 with your text range.

2
Enter the last-value formula

To return the last alphabetical value instead, select an empty cell and enter =IFERROR(INDEX(SORT(FILTER(A10:A999,ISTEXT(A10:A999)*(A10:A999<>"")),1,-1),1),"").

3
Check the result

Press Enter. The formula returns a blank if no matching text is found or if another error occurs; check the source range and formula if the result is unexpectedly blank.

Use FILTER and SORT to find the first or last text value
Text and numbers: These formulas exclude numeric cells. Values stored as text, including text-formatted ZIP codes, are sorted as text.
Work with spreadsheet text

Find alphabetical text values in WPS Spreadsheets

In a WPS Spreadsheets version that supports FILTER and SORT, use a formula to return the first or last nonblank text value without manually sorting your data.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select a result cell: Click an empty cell outside the range you want to search.
  3. 3. Enter the formula: Enter =IFERROR(INDEX(SORT(FILTER(A10:A999,ISTEXT(A10:A999)*(A10:A999<>"")),1,1),1),"") and replace A10:A999 with your range. Change the SORT order from 1 to -1 to find the last value.
  4. 4. Check the result: Press Enter and compare the result with your source data. If the formula does not work, check whether your WPS version supports FILTER and SORT.
Find alphabetical endpoints without rearranging the source columnOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceWork with formulas in a free office suite
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula rearrange my original column?

No. SORT orders the filtered values inside the formula; it does not manually sort or change the source range.

How do I return the last value instead of the first?

In the SORT formula, change the sort order argument from 1 to -1. INDEX then returns the first item in descending order.

What happens if the range contains numbers or blank cells?

The FILTER formulas use ISTEXT and a nonblank check, so numeric cells and empty strings are excluded. Numbers stored as text are included and sorted as text.

Why is my formula result blank?

IFERROR returns a blank when no matching text exists or when the formula encounters another error. Check the range and confirm that your Excel or WPS version supports FILTER and SORT.