backtokally
backtokally

Reputation: 1

Excel to perform addition if cell is even or odd

I've had no luck with a formula to lookup a cell determine if it's odd or even and then perform a function.

The formula will need to lookup A6, if the value is even then it will take B5-3, if the value is odd it will take B5-2.

I've tried this:

=IF(ISEVEN(A6),(B5-3), (ISODD(A6),B5-2))

I'm using open office org and it continues to return an error. I'm a newbie so please be gentle. Thank you for the help.

Upvotes: 0

Views: 589

Answers (2)

Gary's Student
Gary's Student

Reputation: 96763

No IFs are needed, use:

=B5-3+ISODD(A6)

Upvotes: 2

Tom Sharpe
Tom Sharpe

Reputation: 34265

This works for me (don't need to put ISODD - if ISEVEN fails then A6 must be odd), and use semicolon as delimiter in Open Office:-

=IF(ISEVEN(A6);B5-3;B5-2)

Upvotes: 2

Related Questions