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.
 
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

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

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In that case, try ..

rarmn

ABCDEFGHI
2ADEVABACAJAK
3
4AK

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
A4=LOOKUP("ZZ",2:2)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thank you for the formula. I have a list both sorted and unsorted. I made up that example to show the ascending order. This formula works great for me for the sorted list. Thank you once again.
 
Upvote 0
I have a list both sorted and unsorted.
For unsorted try this array formula.
There may be a shorter way, but I couldn't see it! :eek:
This assumes 1 or 2 UPPER CASE letters and/or blank cells in the range.
Formula in S2 is copied down (after Ctrl+Shift+Enter confirmation)

Excel Workbook
ABCDEFGHIJKLMNOPQRS
1'Max':
2ADEVAKAABKAJBSAZBBXBBBS
3AZZAZAAZZA
4
5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
6ABCDEFGHIJKLMNOPQQ
rarmn unsorted
 
Upvote 0
For unsorted try this array formula.
There may be a shorter way, but I couldn't see it! :eek:
This assumes 1 or 2 UPPER CASE letters and/or blank cells in the range.
Formula in S2 is copied down (after Ctrl+Shift+Enter confirmation)

rarmn unsorted

*ABCDEFGHIJKLMNOPQRS
1******************'Max':
2ADEVAKAABKAJBSAZB**B*XBB*BS
3**AZ**ZA*ZAAZ*********ZA
4*******************
5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*XX
6ABCDEFGHIJKLMNOPQ*Q

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:29px;"><col style="width:49px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
S2{=TRIM(CHAR(LEFT(MAX(CODE(RIGHT(" "&A2:Q2,1))+100*CODE(LEFT(RIGHT(" *"&A2:Q2,2),1))),2))&CHAR(RIGHT(MAX(CODE(RIGHT(" "&A2:Q2,1))+100*CODE(LEFT(RIGHT(" *"&A2:Q2,2),1))),2)))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thanks a lot for your help. The formula works great. Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,629
Messages
6,120,630
Members
448,973
Latest member
ChristineC

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