IF statements

%3CLINGO-SUB%20id%3D%22lingo-sub-2417047%22%20slang%3D%22en-US%22%3EIF%20statements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2417047%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20this%20is%20really%20simple%20compared%20to%20all%20the%20questions%20here%20but%20I%20cant%20make%20this%20work.%20I%20want%20to%20create%20the%20following%2C%20but%20Excel%20keeps%20telling%20me%20that%20I%20have%20too%20many%20arguments.%3C%2FP%3E%3CP%3EAny%20ideas%20how%20to%20solve.%3C%2FP%3E%3CP%3E%3DIF(S28%3D%22y%22%2CJ28%2C0%2CIF(S28%3D%22j%22%2CJ28%2C0))%3C%2FP%3E%3CP%3EI%20just%20want%20either%20a%20Y%20and%20a%20J%20to%20produce%20the%20same%20result.%20Originally%20there%20was%20only%20a%20Y.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EJeff%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2417047%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2417367%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20statements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2417367%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1071336%22%20target%3D%22_blank%22%3E%40jeff8ee%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20should%20be%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(S28%3D%22y%22%2CJ28%2CIF(S28%3D%22j%22%2CJ28%2C0))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20I'd%20prefer%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(OR(S28%3D%22y%22%2CS28%3D%22j%22)%2CJ28%2C0)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eor%20even%20shorter%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DIF(OR(S28%3D%7B%22y%22%2C%22j%22%7D)%2CJ28%2C0)%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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