Let's say we have a column of numbers, which includes "L" characters that you want to trim and average separate from the numbers
Since Excel treats numbers and text as text (25L is not 25, it is "25L"), averaging the column only averages the numbers and disregards the text.
Here is the full formula to strip the "L" off the end of the numbers
=IF(ISTEXT(B1),NUMBERVALUE(LEFT(B1,FIND("L",B1)-1)),"")
Let's break this down:
Check for Text, i.e. not a number:
=IF(ISTEXT(B1)
If it is, grab the number value (force the text output to a number)
,NUMBERVALUE(
And then take all the characters left of the "L" (index L - 1) or return blank
LEFT(B1,FIND("L",B1)-1)),"")
and then you can get a column of numbers with "L"s stripped
Since this new column contains numbers, it can be averaged and all numeric formulas should work with it.
Instead of using text with numbers it would be much easier to implement a drop down menu by making a list:
Allow only the list and choose the source as the cells you have your list in. I would put the list either in hidden columns way off to the right of your work area, or on a separate hidden worksheet to not cause confusion.
After you have the list setup, averaging is as simple as =AVERAGEIFS(B1:B9,A1:A9,"Apple")
while replacing "Apple" with whatever your text string is.