I didn't find a worksheet function to do this job but here is a UDF (User-Defined Function) that works like one.
Function Suffixed(Cell As Range) As Integer
Dim Suff As Variant ' list of Suffixes
Dim Word As String ' the word extracted from 'Cell'
Dim L As Integer ' length of suffix string
Dim R As Long ' row counter
Word = Cell.Value
If Len(Word) Then ' skip if blank (return 0)
' set the range in column D, starting in row 2 to the column's end
Suff = Range(Cells(2, "D"), Cells(Rows.Count, "D").End(xlUp)).Value
For R = 1 To UBound(Suff)
L = Len(Suff(R, 1))
If StrComp(Right(Word, L), Suff(R, 1), vbTextCompare) = 0 Then
Suffixed = 1
Exit For
End If
Next R
End If
End Function
Install the code in a standard code module. That is none of the code modules that Excel sets up. You must insert it and its default name will be Module1
. After that you can call the function from the worksheet with the kind of syntax you are accustomed to. For example,
=Suffixed(A2)
The function will return 1 if the word ends on a suffix in your list, else zero. You may modify the code to move the list of suffixes to where you want it. Change two instances of the column letter and one instance of the number 2 which specifies the first row of your list.
' set the range in column D, starting in row 2 to the column's end
Suff = Range(Cells(2, "D"), Cells(Rows.Count, "D").End(xlUp)).Value
The end of the list is dynamic and the code will find it. Don't leave blanks in the list.