Forum Moderators: phranque

Message Too Old, No Replies

Excel sorting question

         

MikeMike

11:53 am on Sep 25, 2002 (gmt 0)

10+ Year Member



I have two columns of numbers: A and B. There is no dublicates per column. I need the numbers sorted so any matching number in A and B will be listed in the same row. Is this possible?

Shane

3:35 pm on Sep 25, 2002 (gmt 0)

10+ Year Member




I think that you will have problems solving this using standard Excel functions given the restrictions on the problem. You could use a database accessed from Excel. This would be the most elegant.

If you can change one of the restrictions on the problem you could use the lookup function to determine the location of the matching value. This would then tell you if the value existed in the other list and where.

Does this help?

..... Shane

4eyes

3:39 pm on Sep 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming I understand the problem correctly, the vlookup command should help you here.

Shane

3:48 pm on Sep 25, 2002 (gmt 0)

10+ Year Member




4eyes,

I don't understand how vlookup will help, but then I read the problem as if I have a 5 in column A and a five in column B I want them side by side. If I have a six in column A and no six in column B then I want a six in column A and a blank in column B.

..... Shane

Jas0n

5:48 pm on Nov 1, 2002 (gmt 0)

10+ Year Member



You might want to provide a quick tabular example to further clarify what you want to do.

The way I read your question is this:

Start with this>

A B
1 5
2 4
3 2
4 6
5 1

Assuming you have no duplicates, I think VLOOKUP may help you. Put Column B in a separate section of spreadsheet or a different tab, sort it in ascending order, name the range (for instance "B_Values" in my formula Below), then past the VLOOKUP formula next to all your Column A Values and you will get something like what is below:

Want to End with This>

AB
11
22
3#N/A
44
55

Formula: =VLOOKUP(A1,B_Values,1,FALSE)

Better yet, if you have MS Access, import them both into a database. Make column A and B separate tables and just do queries to generat tables of Matched and Unmatched records.

Jas0n

sun818

5:52 pm on Nov 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sorry, If this is not what you want to do. But is your goal to see what rows of data are missing from either Column A or Column B? I just suggest alpha sorting each column and copy/paste each column to a text file. Then use a freeware ExamDiff to compare the files for you.