ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Matching Combinations (https://www.excelbanter.com/excel-worksheet-functions/79915-matching-combinations.html)

Rothman

Matching Combinations
 
I have data like so:

Num1 Num2 Num3 Num4 Num5
3 4 10 7 2
6 7 3 8 3
1 7 5 10 2
3 8 1 10 8
....and so forth. Essentially random whole numbers in five columns.

What I'd like to do is to find out if Numx = y, then list the combination.
So, if I was looking for the number 3 in Num1, it'd return a list like (using
the table above):

Num1 Num2 Num3 Num4 Num5
3 4 10 7 2
3 8 1 10 8

I'd have to do this for each column (i.e. if Num2 = some number, then give
me the combinations for that; if Num3 = etc.). For those other columns, I'd
like to keep the horizontal order of the variables intact (e.g. Num2 = 7):

Num1 Num2 Num3 Num4 Num5
6 7 3 8 3
1 7 5 10 2

Any ideas?

Thanks again in advance.

pdberger

Matching Combinations
 
Rothman --

I think you should be able to use DataFilter.
1) Select a cell inside the table.
2) Click DataFilterAutoFilter.
3) At the top of each column, you'll see a little down-arrow. Click the
arrow you want, and pick the 'numx' you want to filter for.

Should do the trick. I think you can designate the output to a different
range of cells, but I forget how right now.

HTH

"Rothman" wrote:

I have data like so:

Num1 Num2 Num3 Num4 Num5
3 4 10 7 2
6 7 3 8 3
1 7 5 10 2
3 8 1 10 8
...and so forth. Essentially random whole numbers in five columns.

What I'd like to do is to find out if Numx = y, then list the combination.
So, if I was looking for the number 3 in Num1, it'd return a list like (using
the table above):

Num1 Num2 Num3 Num4 Num5
3 4 10 7 2
3 8 1 10 8

I'd have to do this for each column (i.e. if Num2 = some number, then give
me the combinations for that; if Num3 = etc.). For those other columns, I'd
like to keep the horizontal order of the variables intact (e.g. Num2 = 7):

Num1 Num2 Num3 Num4 Num5
6 7 3 8 3
1 7 5 10 2

Any ideas?

Thanks again in advance.



All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com