excel formulas

Copper Contributor

Hello!

I'm looking for a formula that will achieve the following:

Currently, Cell A1 has the word "yes"

Cell  B1 has the word "no"

I would like to the following to appear in C1.

If cells A1 and B1 contain "yes", I would like to see a value of 0 in C1

If cells A1 and B1 contain "no", I would like to see a value of 0 in C1.

If A1 contains "yes" but B1 contains "No" I would like to see a value 100 in cell C1.

If A1 contains "no" and B1 contains "yes", I would like to see -100 in cell C1.

Looking for some help from the excel guru's out there.

Thanks in advance!

Schrambo4430

 

2 Replies

@schrambo4430 

 

You need to get acquainted with the IFS function,

 

=IFS(AND(A1="yes",B1="yes"),0,AND(A1="no",B1="no"),0,AND(A1="yes",B1="no"),100,AND(A1="no",B1="yes"),-100)

 

Or, if you want to get fancier with nested conditions

=IFS(OR(AND(A1="yes",B1="yes"),AND(A1="no",B1="no")),0,AND(A1="yes",B1="no"),100,AND(A1="no",B1="yes"),-100)

 

I'm quite sure there are other variations as well.

 

I’ll be taking webinars on these fuctions, including IFS.
Thanks for reaching out and helping.
Schrambo4430