Violetta Katykhin
Violetta Katykhin

Reputation: 3

Excel nested if statement error how to fix?

trying to do a nested if :

=IF([Years of Service]>10,'Data Tables'!$B$11,"if([years of service]>5,'Data Tables'!$b$10)")

getting a spill error.

Upvotes: 0

Views: 359

Answers (1)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60224

You don't indicate what you want to do and I'm not sure exactly what you really want to do.

But it seems your formula is within a Table. That being the case, formulas that output arrays, when placed in a Table will produce the #SPILL! error.

If, what you want to do, is to compare the Years of Service from the same row as the formula, then you need to refer just to that row, so as to not output an array.

eg:

=IF([@[Years of Service]]>10,'Data Tables'!$B$11,
IF([@[Years of Service]]>5,'Data Tables'!$B$10,
IF([@[Years of Service]]>1,'Data Tables'!$B$9,
'Data Tables'!$B$8)))

If you want something else, then you'll need to provide more detail.

Upvotes: 1

Related Questions