I have a sub called GETCOLOR which retrieves the index color of a cell.
If I type it directly as =GETCOLOR (AJ6,”index”) it yields the background color of cell AJ6, which is 14 (green)
However, I need to get the background color of that same cell, but expressed as the result of a VLOOKUP function. AJ6 is the output of the function =VLOOKUP($D$5,$CV$2:$CW$314,2,FALSE) and I need to use that as the cell (first) argument for the GETCOLOR sub.
If I use it this way =GETCOLOR(VLOOKUP($D$5,$CV$2:$CW$314,2,FALSE),“index”) I get a #VALUE! Error
“Excel Formulas and Functions for Dummies” states that for the function =CELL(“contents”,A1), if the argument cell contains a formula, the function returns the result of the formula and not the formula itself. Since the output of the VLOOKUP is AJ6, I tried the following:
=GETCOLOR(CELL(“contents”,(VLOOKUP($D$5,$CV$2:$CW$314,2,FALSE)),“index”), but it says I’ve entered too many arguments for this function.
I suspect that it has something to do with the placement of parentheses, but none of the placement combinations I've tried have worked. I'm sure it's something obvious and simple, but I can't seem to solve it - can anyone point out my error(s)?