1

I'm trying to combine the INDIRECT and IF functions together so I can drag formulas down without getting a #REF! error when I run my macro. Currently, I have one sheet that has all the IF functions and another sheet that it refers to. The current IF function is:

=IF('First Half'!T2="Loblaws","CA",IF(RIGHT('First Half'!T2,6)="Canada","CA","US"))

First Half is the sheet and T2 is the referenced cell. I want to be able to use INDIRECT so if the reference row 2 gets deleted, I won't get a #REF! error. But I also want the formula to be dragged down to reference T3 on the next row.

4

1 に答える 1

1

試してください(Row2で、またはそれぞれにオフセットを適用してくださいROW()):

=IF(INDIRECT("'First Half'!T"&ROW())="Loblaws","CA",IF(RIGHT(INDIRECT("'First Half'!T"&ROW()),6)="Canada","CA","US"))
于 2015-03-18T19:35:24.800 に答える