Google-sheets – Formula or script for highest number starts with alpha

google sheetsgoogle-apps-scriptworksheet-function

I am looking for a formula or script that can show me the highest number within a range of values that have a leading alpha character. For example:

D101
D102
D103
D104
J101
J102
J103

I would like a cell that shows the highest D# in column is: D104 & highest J# in col is J103.

I tried using RIGHT, in combination with MAX but was unsuccessful. This is the formula I tried which evaluates to 0:

=MAXA(B:B,RIGHT(B:B,3))

Best Answer

Please try:

=ArrayFormula(max(value(right(filter(A:A,Left(A:A)="D"),3))))

and adjust D to the letter of your choice (or parameterise it).

MAX
VALUE
RIGHT
FILTER
LEFT

Expect 0 from attempts at maths operations on string functions since these always return Text.