I'm having trouble creating a nested if statement. I have to figure out how much bonus money is paid out to an employee based on their pay grade. Pay grades:

Bonus Pay Grade 1 amount (located in cell Y2): $3,000

Bonus Pay Grade 2 amount (located in cell Y3): $6,000

Bonus Pay Grade 3 amount (located in cell Y4): $8,000The Bonus column is I2:I101

This is what I have for my formula:

IF((I2=1,Y2, IF(I2=2,Y3, IF(I2=3,Y4))))

The program doesn't seem to like it and I'm not sure why. Is it nested correctly? Where did I go wrong? Any help would be hugely appreciated. Thanks!!!!

This appears to be homework.

So I won't give you the answer but just ask:Why do you have a third =IF(), what's the logic?

MIKE

The logic corresponds to the third pay grade. Is that where I'm going wrong? (A yes or no will suffice). All I'm trying to do is figure out where I'm going wrong.

Yes. Remember an =IF() function is composed of:

=IF(Logical_test , Value_if_true , Value_if_false)

You have only three conditions.

MIKE

Thanks! I guess I was getting confused between the fact that I need all three conditions to make it work. I even tried typing up the statement in notepad on separate lines.

=IF(I2=1,Y2, IF(I2=2,Y3, IF(I2=3,Y4)))

Close, but no cigar. The major hint here is that you have only three conditions.

Remember:

=IF(Logical_test , Value_if_TRUE , Value_if_FALSE)

MIKE

=IF([Pay Grade]=1,$Y$2,IF([Pay Grade]=2,$Y$3, $Y$4))

Ask Your Question

Weekly Poll

Do you think manufacturers should do more to reduce phone and tablet usage among kids?

Discuss in The Lounge

Poll History