I am using XL2003 in Windows Vista Enterprise
So, I have two tables.
One is called Reference Table
and the other is called Result Table.
(This is a much simpler version of what I need to do)
Reference Table: (This table is in the worksheet, "Reference", top-left corner being in A1 and the whole table is defined as name "REFR")
A | B | C | D | |
1 | Param1 | Param2 | Result1 | Result2 |
2 | 1 | 4 | 20 | 1 |
3 | 1.5 | 8 | 34 | 5 |
4 | 3 | 8 | 57 | 4 |
5 | 4 | 9 | 21 | 3 |
6 | 10 | 8 | 53 | 7 |
7 | 10 | 1 | 97 | 52 |
8 | 30 | 8 | 10 | 68 |
F | G | H | I | |
1 | Param1 | Param2 | Result1 | Result2 |
2 | 1 | 4 | ||
3 | 1.5 | 8 | ||
4 | 3 | 8 | ||
5 | 4 | 9 | ||
6 | 10 | 8 | ||
7 | 10 | 1 | ||
8 | 30 | 8 |
and the other one only has parameters1 and 2 filled in with different orders.
Now, I want to be able to 'lookup' the Reference Table and fill into the according rows.
So, the result table would be like this:
A | B | C | D | |
1 | Param1 | Param2 | Result1 | Result2 |
2 | 1.5 | 8 | 34 | 5 |
3 | 4 | 9 | 21 | 3 |
4 | 10 | 1 | 53 | 7 |
5 | 30 | 8 | 10 | 68 |
6 | 10 | 8 | 53 | 7 |
7 | 3 | 8 | 57 | 4 |
8 | 1 | 4 | 20 | 1 |
It looks fairly simple, however here is the catch.
I need to use a formula, not VBA and refrain from using IF statements if possible
Regardless of the order or number of rows or columns, it must input the correct values into the according record of data using/checking Param1 and Param2
I've learned how to achieve that with VLOOOKUP
but it would only compare one parameter.
This is my formula in C2 (Result1) of Result Table:
Code: Select all
=VLOOKUP($A1,REFR,MATCH(C$1,OFFSET(REFR,0,0,1),0),FALSE)
It looks up the same value in A1 of the Result table in Reference table then it matches the exact titles and returns whatever is beneath the matched title.
It works fine but the problem is..
whatever it is looking up, it only returns the first value it finds in the reference table.
So instead of Correct Table shown below
F | G | H | |
1 | Param1 | Param2 | Result1 |
2 | 1 | 4 | 20 |
3 | 1.5 | 8 | 34 |
4 | 3 | 8 | 57 |
5 | 4 | 9 | 21 |
6 | 10 | 8 | 53 |
7 | 10 | 1 | 97 |
8 | 30 | 8 | 10 |
F | G | H | |
1 | Param1 | Param2 | Result1 |
2 | 1 | 4 | 20 |
3 | 1.5 | 8 | 34 |
4 | 3 | 8 | 57 |
5 | 4 | 9 | 21 |
6 | 10 | 8 | 97 |
7 | 10 | 1 | 97 |
8 | 30 | 8 | 10 |
I know I've rambled on but could anybody help me?
Thank you very much,
Kevin :)