View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Auto Generate Sorting table??

One thought ..

Assuming source data in Sheet1, cols A and B, from row1 down (data in col B
is assumed to be only numbers)

In Sheet2,

Put in A1:
=IF(ISERROR(SMALL($C:$C,ROW())),"",IF(INDEX(Sheet1 !A:A,MATCH(SMALL($C:$C,ROW()),$C:$C,0))=0,"",INDEX (Sheet1!A:A,MATCH(SMALL($C:$C,ROW()),$C:$C,0))))

Copy A1 to B1

Put in C1:
=IF(AND(Sheet1!A1="",Sheet1!B1=""),"",IF(AND(Sheet 1!A1<"",Sheet1!B1=""),10^10+ROW(),Sheet1!B1+ROW()/10^10))

Select A1:C1, copy down to cover the max expected extent of source data in
Sheet1, down to say row500? Hide away col C. Cols A and B will return the
results that you seek, all neatly bunched at the top. Results returned will
be dynamic to data changes in Sheet1.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"daniellchiu via OfficeKB.com" <u36625@uwe wrote in message
news:79d1e00ded5cd@uwe...
How can I generate Sorting table automatic from sheet 1 to Sheet 2?? cause
Date in sheet 1 always change
Sheet 1
A B
1 3
2
3 2
4 1
5 1

Sheet 2
A B
4 1
5 1
3 2
1 3
2

Thanks!!

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200710/1