Create formula with string as source

Viewed 50

Can I create a formula with a separate cell to direct to a specific cell of column in that formula?

For example, I'm now having this formula to compare two column values:

=arrayformula(if(I3:I=J3:J;"√";"Check"))

I don't constantly want to manually edit the formula if I want to compare other columns, lets say: A to B. It would be ideal to have two cells with where I can type in "A" and "B".

So the formula could look something like this:

=arrayformula(if(<cell A1>3:<cell A1>=<cell A2>3:<cell A2>;"√";"Check"))

Content in cell A1: A Content in cell A2: B

Should create the formula: =arrayformula(if(A3:A=B3:B;"√";"Check"))

Of course this currently doesn't work because A and B are strings.

1 Answers

Use INDIRECT:

=arrayformula(if(<cell A1>3:<cell A1>=<cell A2>3:<cell A2>;"√";"Check"))

would be

=arrayformula(if(INDIRECT(A1&3&":"&A1)=INDIRECT(A2&3&":"&A2);"√";"Check"))

However, due to performance issues, It is not recommended to use INDIRECT

Related