How can I use a formula to sort text values?

stuckagain22

Board Regular
Joined
Aug 4, 2006
Messages
183
I have a sheet that I want to auto sort the data in one column into another column.

In Example:

If column A contains:

peach
apple
orange

I want column B to then show:

apple
orange
peach

Is there anyway to do this using a function/formula?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
In C1 (fill down)
=IF(ISBLANK(A1),300,CODE(A1))

In column B
=INDEX(A:A,MATCH(SMALL(C:C,ROW()),C:C,0),1)
 
Upvote 0
Thanks, but this only indexes the value of the first text character. If there are several values that start with the same character, then they would not be alphabetical ie:

peach
pear
pomegranate
 
Upvote 0
Thanks, but this only indexes the value of the first text character. If there are several values that start with the same character, then they would not be alphabetical ie:

peach
pear
pomegranate

If you have already installed the free morefunc.xll add-in...
Book5
ABCD
15
2peachapple
3pearcranberry
4pomegranatepeach
5applepear
6cranberrypomegranate
7 
Sheet1


C1:

=COUNTA(A2:A6)

C2, copied down:

=IF(ROWS($C$2:C2)<=$C$1,INDEX(VSORT($A$2:$A$6,$A$2:$A$6,1),ROWS($C$2:C2)),"")
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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