R
Ruleroftheblind
Let's say I have an annoyingly long function in D1 and I want it in D2, D3,
D4...D7. And in my function are all sorts of variables and refrences. Is it
possible to copy the function to the remaining cells while only changing a
few select variables in the functions? Specifically, I'd like for it to
change the "col_index_num" in my Vlookups.
Here is the function that I'd like to copy:
=IF(B1=Sheet2!A2,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A3,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A4,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A5,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A6,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A7,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet!A8,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),"False")))))))
The part I'd like to change is the repeating 2's. In cell D2 I'd like them
to be 3's. In D3 I'd like them to be 4's. And so on and so forth.
Any help would be appreciated.
Or if you know of a way to condense the above function, that'd be great too.
Thanks.
D4...D7. And in my function are all sorts of variables and refrences. Is it
possible to copy the function to the remaining cells while only changing a
few select variables in the functions? Specifically, I'd like for it to
change the "col_index_num" in my Vlookups.
Here is the function that I'd like to copy:
=IF(B1=Sheet2!A2,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A3,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A4,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A5,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A6,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet2!A7,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),
IF(B1=Sheet!A8,VLOOKUP(B1,Sheet2!A1:G8,2,FALSE),"False")))))))
The part I'd like to change is the repeating 2's. In cell D2 I'd like them
to be 3's. In D3 I'd like them to be 4's. And so on and so forth.
Any help would be appreciated.
Or if you know of a way to condense the above function, that'd be great too.
Thanks.