I cannot seem to solve this possibly simple excel function problem (Not VBA). In Microsoft Excel Array: I want to find a column that contains all values from a list(numbers) and return that column position in the array (numerical values).
Col1 | Col2 | Col3 | Col4 | Col5 |
---|---|---|---|---|
4 | 8 | 4 | 7 | 4 |
1 | 4 | 2 | 9 | 10 |
9 | 3 | 2 | 8 | 8 |
10 | 3 | 2 | 6 | 10 |
10 | 5 | 8 | 4 | 9 |
5 | 9 | 1 | 9 | 5 |
5 | 5 | 5 | 6 | 4 |
4 | 1 | 5 | 1 | 2 |
ValuesList:
val1 | val2 | val3 | val4 |
---|---|---|---|
1 | 4 | 6 | 9 |
ValidColumn(s)#: 4
Array(Table): arrayTable1
Formula(function) Tested using (CTR+SHIFT+ENTER):
{=SMALL(IF(($A$2:$E$9)*($A$12:$A$15),COLUMN($A$2:$E$9)-COLUMN($A$2)+1),ROWS($1:$5))}
The formula generated: #N/A
Thanks in advance for your help.
Edit to clarify formula requirements/additional info:
1: Using Microsoft Excel 2010 version. Some newer functions not available.
2: Can use functions like: v/h/lookup,small/large,index,match,countif/countifs,sumproduct,mode,mmult,transpose,aggregate,indirect,etc.
3: Actual data set for array (table) is hundreds of columns and growing. This means I need a formula that can check the whole array AND return columns# (4,etc.) that matches (contains) all the values in the list (criteria).
4: Brainstorming
I saw some other answers that had basic lookup concept, but they did not include searching a whole table array at the same time.
Formula concept1:
{=SMALL(IF(INDEX(IFERROR(--($A$2:$E$9=$A$12:$A$15),0),,),COLUMN($A$2:$E$9)-COLUMN($A$2)+1),ROW($1:$5))}
The formula generated: incorrect results (possibly first value column location only)
Formula concept2:
{=IFERROR(MODE.MULT(IF((INDEX((((($A$2:$E$9=$A$12)*COLUMN($A$2:$E$9))+(($A$2:$E$9=$A$13)*COLUMN($A$2:$E$9))+(($A$2:$E$9=$A$14)*COLUMN($A$2:$E$9))+(($A$2:$E$9=$A$15)*COLUMN($A$2:$E$9)))),,)<>0),COLUMN($A$2:$E$9))),"")}
The formula generated: 4
*This formula is not a solution to original problem and will only work under specific instances to solve a specific problem. I will explain more in an answer below.
Possible relevant links to other answers?:
Ref: can-match-function-in-an-array-formula-to-return-multiple-matches
Ref: excel-match-multiple-criteria
Ref: match-function-to-match-multiple-values
Ref: excel-modal-value-in-list-with-if-function
Ref: how-do-you-extract-a-subarray-from-an-array-in-a-worksheet-function
Ref: can-excels-index-function-return-array
Edit: For our purposes @EEM solution is currently the easiest to implement, validate, and maintain. Thanks for all responses.