Forum Discussion
Unexpected result from new calc engine using IF, INDIRECT, ROW
- _K_O_Mar 31, 2020Copper Contributor
Thanks Detlef_Lewin
Wrapping INDIRECT with T( ) still returns the value as an array (i.e. { }) which is what is causing the problem inside the if for the version of Excel w/o the new calc engine.
- JKPieterseMar 31, 2020Silver ContributorExcel appears not to understand that INDIRECT (in this case) is returning a single value. If you add an @ in front of the INDIRECT the results are as expected. I think this is a bug of the function evaluator.
- _K_O_Mar 31, 2020Copper Contributor
Thanks and I tend to agree I think there is a bug in the formula evaluator.
I'm not certain the problem is solely with the INDIRECT function. In formula 1 ROW returns a single value (as would be expected) and thus INDIRECT has no problem. In formula 2 (when inside an IF function) ROW returns an array which then causes INDIRECT to return an array (even though there is only 1 cell reference inside ROW). Further testing I removed the INDIRECT so just =ROW(A28) which returns 1 value (not an array) and =IF(ROW(A28),1,"") in which case ROW also only returns 1 value (not an array). So the problem is only when ROW is inside an INDIRECT and INDIRECT is inside an IF.