Sorting number in multiple rows

S

sluvian

I'm trying to sorting numbers in two seperate rows.
1 4
5 6
3 2
i want them to sort, and end up looking like this
1
2
3
4
5
6
 
L

Lars-Åke Aspelin

I'm trying to sorting numbers in two seperate rows.
1 4
5 6
3 2
i want them to sort, and end up looking like this
1
2
3
4
5
6

Assuming that you mean two columns (not rows) as shown in your example
and that the numbers are in columns A and B starting on row 1.

If a certain number can only be present in at most one of the columns,
you may try the following formula in cell C1:

=IF(ISERROR(MATCH(SMALL($A$1:$B$100,ROW()),A$1:A$100,0)),"",SMALL($A$1:$B$100,ROW()))

Change the 100 in all places to fit the maximum size of your data in
columns A and B.

Copy this formula to cell D1 and then fill cells C1:D1 down as far as
needed.

If a certain number can be present in both columns, you have to
specify what the input should look like. Should the number be on one
or columns in the output? If two columns, in which column should the
number be listed first.

Hope this helps / Lars-Åke
 
S

sluvian

That worked for 1,2 and 3.

there's 2 tables, same columns. how would i use that to sort the tables of
two columns?

does that make sense?
 
L

Lars-Åke Aspelin

With the input according to your example, i.e.
1 in cell A1
4 in cell B1
5 in cell A2
6 in cell B2
3 in cell A3
2 in cell B3

and the proposed formula, that is
=IF(ISERROR(MATCH(SMALL($A$1:$B$100,ROW()),A$1:A$100,0)),"",SMALL($A$1:$B$100,ROW()))
in cells C1 to C6 and
=IF(ISERROR(MATCH(SMALL($A$1:$B$100,ROW()),B$1:B$100,0)),"",SMALL($A$1:$B$100,ROW()))
in cells D1 to D6

what output do you get in these cells
C1: ???
D1: ???
C2: ???
D2: ???
C3: ???
D3: ???
C4: ???
D4: ???
C5: ???
D5: ???
C6: ???
D6: ???

Lars-Åke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top