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.
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Robert Mika

MrExcel MVP
Joined
Jun 29, 2009
Messages
7,256
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?
 

rarmn

New Member
Joined
Apr 30, 2013
Messages
20
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.
 

Robert Mika

MrExcel MVP
Joined
Jun 29, 2009
Messages
7,256
<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th><th>J</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;"></td><td style=";">A</td><td style=";">A</td><td style=";">AA</td><td style=";">AB</td><td style=";">AC</td><td style=";">AZ</td><td style=";">C</td><td style=";">G</td><td style=";">AF</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">AZ</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">C3</th><td style="text-align:left">{=INDEX(<font color="Blue">$A$1:$J$1,1,MATCH(<font color="Red">LARGE(<font color="Green">IF(<font color="Purple">A1:J1<>"",IF(<font color="Teal">LEN(<font color="#FF00FF">A1:J1</font>)=1,CODE(<font color="#FF00FF">MID(<font color="Navy">A1:J1,1,1</font>)</font>),CODE(<font color="#FF00FF">MID(<font color="Navy">A1:J1,1,1</font>)</font>)+CODE(<font color="#FF00FF">MID(<font color="Navy">A1:J1,2,1</font>)</font>)</font>)</font>),1</font>),IF(<font color="Green">A1:J1<>"",IF(<font color="Purple">LEN(<font color="Teal">A1:J1</font>)=1,CODE(<font color="Teal">MID(<font color="#FF00FF">A1:J1,1,1</font>)</font>),CODE(<font color="Teal">MID(<font color="#FF00FF">A1:J1,1,1</font>)</font>)+CODE(<font color="Teal">MID(<font color="#FF00FF">A1:J1,2,1</font>)</font>)</font>)</font>),0</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

raj2206

Board Regular
Joined
Jul 23, 2012
Messages
213

ADVERTISEMENT

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
 

raj2206

Board Regular
Joined
Jul 23, 2012
Messages
213

ADVERTISEMENT

Peter, you made this awfully simple :) Nice!
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
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.
 

rarmn

New Member
Joined
Apr 30, 2013
Messages
20
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,841
Members
414,342
Latest member
K Darrell Smith

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
Top