Ongoing alphabetized list

Sneech#7

Active Member
Joined
Oct 22, 2004
Messages
284
I'm not sure if this is possible. Does anyone know of a way to maintain two lists of data where items are added to to random locations within the first one and the second one always lists all items in alphabetical order ? (Without having to run anything to do it; i.e. with formulas and/or functions). Assume up to 300 items. There may be gaps of several rows of spaces in the first list, so it would have to be defined as going from row 1 to row 300, rather than by contiguous data. Thank you for any help.
 
Hi Sneech#7

I have a solution for alphabetizing lists but it consists of big array formulas and it’s very slow for lists as big as yours, I tried your example of a list with 300 items, each one with 10 letters, and it takes more than 4 seconds to update each time you change one item.


It’s great and very practical for small lists though.


Anyway, I never saw a solution for alphabetizing lists published (maybe because I’m new at the board), so here is my solution:

Your list is in A1:A300
In B1:B300 you have your list sorted, with the blanks at the end as you wanted.


There are two formulas, one for B1 and another for B2:B300

B1=IF(ROWS($A$1:$A$300)=COUNTBLANK($A$1:$A$300),"",INDEX($A$1:$A$300,MATCH(ROW()-ROW($A$1),COUNTIF($A$1:$A$300,"<"&$A$1:$A$300)+ISBLANK($A$1:$A$300)*1000,0),1))

B2=IF(ROW()-ROW($A$1)>=ROWS($A$1:$A$300)-COUNTBLANK($A$1:$A$300),"",IF(ISERROR(MATCH(ROW()-ROW($A$1),COUNTIF($A$1:$A$300,"<"&$A$1:$A$300),0)),B1,INDEX($A$1:$A$300,MATCH(ROW()-ROW($A$1),COUNTIF($A$1:$A$300,"<"&$A$1:$A$300)+ISBLANK($A$1:$A$300)*1000,0),1)))

Copy B2 to the cells B3:B300

The formulas are big and ugly because I could not find an elegant solution that takes into account the case of several strings in your list being equal. If you are sure that your list never has duplicate entries you can simplify the formulas.

They are valid to a list of up to 1000 items,
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Guys, with all due respect, I know several VBA options... I'm wondering if there is a non-VBA solution that makes sense, if anyone has done this type of thing with cell functions. :-D
AlphanumericSortByMeansOfFormulas.xls
ABCD
113
2ListAscending OrderRankSortedList
3Mac87Access
4Apple32Apple
5Unix1312eBay
6Navision98Excel
7Windows1413Firefox
8Excel54GNumeric
9eBay43Mac
10SAP1110Navision
11Navision99Navision
12Access21SAP
13  Thunderbird
14Firefox65Unix
15Thunderbird1211Windows
16GNumeric76 
17
Sheet1


B3, copied down:

=IF(A3<>"",SUMPRODUCT((A3>$A$3:$A$16)+0)+1,"")

C3, copied down:

=IF(N(B3),RANK(B3,$B$3:$B$16,1)+COUNTIF($B$3:B3,B3)-1,"")

D1:

=MAX(C:C)

D3, copied down:

=IF(ROWS(D$3:D3)<=$D$1,INDEX($A$3:$A$16,MATCH(ROWS(D$3:D3),$C$3:$C$16,0)),"")
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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