Google-sheets – Parse error with =IF function

google sheets

I put this in:

=IF(A4=2;1,(A4=4;7,A4))

and it keeps coming up with a parse error and I have tried to switch ; with , and it still didn't work.

How do I make this work?

Best Answer

Maybe this is what you need ?

=IF(A4=2;1;IF(A4=4;7;A4))

or, depending on your locale:

=IF(A4=2, 1, IF(A4=4, 7, A4))