IF statements

Copper Contributor

Hi, this is really simple compared to all the questions here but I cant make this work. I want to create the following, but Excel keeps telling me that I have too many arguments.

Any ideas how to solve.

=IF(S28="y",J28,0,IF(S28="j",J28,0))

I just want either a Y and a J to produce the same result. Originally there was only a Y.

Thanks

Jeff

2 Replies

@jeff8ee 

If should be

 

=IF(S28="y",J28,IF(S28="j",J28,0))

 

But I'd prefer

 

=IF(OR(S28="y",S28="j"),J28,0)

 

or even shorter

 

=IF(OR(S28={"y","j"}),J28,0)

@Hans Vogelaar 

Or even

=XOR((S28={"y","j"}))*J28