Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have 2 sets of data.
set1:a,b,c,d,e,f
set2:a,c,d,f
how can I sort it into 2 columns like this:
a a
b
c c
d d
e
f fThanks

It appears to be a simply request but in my eyes it is not unless I am just not thinking correctly at the moment.
I have sent you a worksheet "FindNth1.xls"
It contains a macro and much instructions.
The macro modified by me was originally created by Dave Hawley of OzGrid.com for another purpose.Also, if you had ten sets of data then you can add more columns and just need to change the occurance to 2, 3, 4...etc to return the correct values.
If your sets of data was an example and the value that you wanted to return was in another column then you need to change that within the formula too.
If you have the need to use the macro often I suggest you open it and save it as a Template for easy access.
If you don't want your spreadsheet to contain the macro then simply open the template and the User defined function will be available in your worksheet too. Otherwise you can copy the sheet from within the workbook and paste it to another workbook when you are done with it.If you have questions I should be able to assist.
Regards,
Bryan

Thanks Bryan.
You are right. It not a simply request at least not easy for me.
I still haven't received your email yet. could you please zip it up and send again? It may be blocked
many thanks

Yes, it came back as Delivery failure.
I zipped it and resent it.
If you do save the file as a template then use the name FindNth vs FindNth1.
Bryan

That's two strikes.
Do you want to go for three on that same address, provide another address or call it quits now?Bryan

I don't know why I was attempting to email it.
It is available at the following link by right clicking and selecting "Save target as":
FindNth.zipLet me know once you have it so I can remove it from my webspace.
Best regards,
Bryan

Thanks Bryan.
I got it from your link. It wroks great.
Thanks a lot.
Can I ask a futher question? I'd like expended on sort not for just one column,but a group of columns. Something like this:
data1 data2
a 50 a 50
b 40 b 45
c 30
d 20 d 15
e 10
f 5 f 55Thanks in advance

Not sure exactly what you are wanting above without seeing but if I understand correctly then the result would need to look like:
A B C (columns)
a 50 50
b 40 45
c 30
d 20 15
e 10
f 5 55Column A would be what you are looking for, column B would be the first occurance and column C would be the second occurance of values associated with the values in column A.
Being a User Defined Function (UDF) it shows up in the fx button's menu.
To view it's code hit Alt+F11.Regards,
Bryan

![]() |
import xls file
|
Word Page 1 printing to w...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |