Share via

IF function with three outputs

Anonymous
2018-02-23T20:26:00+00:00

I'm trying to use a function that will allow three outputs based on the values in two different cells.

=IF(AND(H2>I2),-27,-11,IF(AND(H2=0,I2=0))

This is the formula I'm trying, but it tells me I have an error.  I can get the first part to work, but not the second half.

If H2 has a balance I want the value to be -27, if I2 has a balance I want the value to be -11, if neither H2 or I2 have a balance I want the value to be 0. 

Any suggestions?  Thanks in advance!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-02-23T20:30:48+00:00

You didn't mention what you wanted if both H2 and I2 have a balance, so this formula doesn't account for that, but this will do the rest of what you want in the order of checking H2 first, and then I2:

=IF(H2<>"",-27,IF(I2<>"",-11,0))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2018-02-23T20:49:19+00:00

They will never both have a balance at the same time.  Thank you so much!  That worked!

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2018-02-23T20:51:36+00:00

    Good to hear

    Was this answer helpful?

    0 comments No comments