Max in a list of alphabets/texts

rarmn

New Member
Joined
Apr 30, 2013
Messages
20
Hello,

I have a list in increasing order of value

A,B,C,...,Z,AA,AB,AC,...,AZ,BA,BB,...,BZ (so on)

I want to find the maximum in this list. max should be "BZ" and minimum should be "A" in the above list.

Any suggestions.

Thanks.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello,

I have a list in increasing order of value

A,B,C,...,Z,AA,AB,AC,...,AZ,BA,BB,...,BZ (so on)

I want to find the maximum in this list. max should be "BZ" and minimum should be "A" in the above list.

Any suggestions.

Thanks.
Is this in column or a cell?
Are there only 1-2 letters values?
 
Upvote 0
Is this in column or a cell?
Are there only 1-2 letters values?

There are only one and two letters. The list is in a row. I want the maximum letter from the list.
for eg. A < B < C ....< Z < AA < AB ....< AZ < BA ...

Thanks.
 
Upvote 0

Excel 2010
ABCDEFGHIJ
1AAAAABACAZCGAF
2
3AZ
Sheet1
Cell Formulas
RangeFormula
C3{=INDEX($A$1:$J$1,1,MATCH(LARGE(IF(A1:J1<>"",IF(LEN(A1:J1)=1,CODE(MID(A1:J1,1,1)),CODE(MID(A1:J1,1,1))+CODE(MID(A1:J1,2,1)))),1),IF(A1:J1<>"",IF(LEN(A1:J1)=1,CODE(MID(A1:J1,1,1)),CODE(MID(A1:J1,1,1))+CODE(MID(A1:J1,2,1)))),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hey, Thanks for writing!!

You can use the following formula:

=INDEX(A1:A9,MATCH(MAX(CODE(A1:A9)+
IFERROR(CODE(MID(A1:A9,2,1)),0)),CODE(A1:A9)+IFERROR(CODE(MID(A1:A9,2,1)),0),0))


Please change the referencing as per the requirement, in my case the values were in A1:A9.
Make sure you press Control+Shift+Enter while entering the formula, since its an array operation.


Hope this will work.

Thanks/Raj
 
Upvote 0
Would this work for not sorted range?
No, it would always return the right-most entry.
But the OP did state that the list is in order of increasing "size", confirmed by both the examples provided and that's what I based my response on.
 
Upvote 0
Excel 2010
ABCDEFGHIJ
1AAAAABACAZCGAF
2
3AZ

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
C3{=INDEX($A$1:$J$1,1,MATCH(LARGE(IF(A1:J1<>"",IF(LEN(A1:J1)=1,CODE(MID(A1:J1,1,1)),CODE(MID(A1:J1,1,1))+CODE(MID(A1:J1,2,1)))),1),IF(A1:J1<>"",IF(LEN(A1:J1)=1,CODE(MID(A1:J1,1,1)),CODE(MID(A1:J1,1,1))+CODE(MID(A1:J1,2,1)))),0))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Thank you for the formula. But when i have "AZ" and "ZA" in the list if "AZ" occurs first the formula will pick "AZ" because the code value is 155 for both "AZ" and "ZA". Any suggestions. Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top