Help needed on sorting formula

stuckagain22

Board Regular
Joined
Aug 4, 2006
Messages
183
I am trying to get the following formula to alphabetically sort data:

Code:
=INDEX(data,MATCH(ROW(INDIRECT("1:"&ROWS(data)))-1,COUNTIF(data,"<" &data),0))

Cell A1: pear
Cell A2: apple
Cell A3: orange

cells A1:A3 are named as: data

The formula above results in: #N/A

Could someone please help me out with this.

Thanks.


Thanks.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
why not just sort in the worksheet or in vba.

see help in worksheet and vbeditor.

the macro in vba will be something like this

Code:
Sub test()
Range("data").Sort key1:=Range("data"), Order1:=xlAscending

End Sub
 
Upvote 0
Hi stuckagain22

Thanks, but that is where the formula is from... and it doesn't work.

Yes it does. As it's said in the link this is a multi-cell array formula.
You have to follow the instructions exactly:

- Select the a number of cells (in the example C2:C21)
- type (or paste) the formula in the formula bar
- confirm with Ctrl+Shift+Enter (and not just Enter).

Hope this helps
PGC
 
Upvote 0
edit: Woops, way too slow - didn't see your post pgc01
Thanks, but that is where the formula is from... and it doesn't work.
Try again, noting the first part of this instruction from the page:
Select C2:C21 and type (or paste) the formula below. Then press Ctrl+Shift+Enter (rather than Enter).
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,168
Members
448,870
Latest member
max_pedreira

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