Find the First or Last Alphabetical Text Value in Excel
Question details
Find the first or last nonblank text value alphabetically in a range without manually sorting the column.

- 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.
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.
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.
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.
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),"").
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 a LOOKUP array formula in older Excel versions
Use this approach when SORT and FILTER are unavailable and the range contains ordinary text values.
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. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
- 2. Select a result cell: Click an empty cell outside the range you want to search.
- 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. 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.

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.




