# Thread: IFODD statement help (Office XP)

1. ## IFODD statement help (Office XP)

Could someone give me a hand working with the IFODD function. I can get it to work by itself, but not within IF statement when AND is also included.

For example:

A1 can be set to "x" or" y".
A2 can be an EVEN or ODD number.
A3 should return "xxx" if A1 is "x", but should apply the ISODD function in reference to A2 if A1 is "y".

So, I'd like something similar to this (which does not work) to be applied to A3:

=IF(A1="x", "xxx",IF(AND(A1="y",ISODD(A2)),ISODD(A2),(anyforum lahere),0))

I know the above forumla is not correct, but have played with variations of ISODD(A2) and am unable to make it work within an IFstatement which also includes the AND function.

Can the ISODD function work within an IF statement with the AND function?

Thanks,
BH Davis

2. ## Re: IFODD statement help (Office XP)

I've only got XL 97 but is the attached any use?

(not) stuck

3. ## Re: IFODD statement help (Office XP)

It's not clear what you want. Should ISODD be included in the criteria, or in the result of the formula, and how?

This formula is at least valid (if you substitute something for "anyformulahere", but it may not do what you want:

=IF(A1="x","xxx",IF(AND(A1="y",ISODD(A2)),"anyform ulahere",0))

4. ## Re: IFODD statement help (Office XP)

Hans,

I though I had written that out clearly, but I can see now where it left it open to question. Anyway, the ISODD is in the criteria, and your formula did the trick. I would have sworn though that I had tried it that way.....must not have or possibly I had a glitch somewhere else at that point.

Anyway, here it is as applied in the worksheet. It appears to be working correctly now.

Forgive the unnecessary repeats of the "or" statements.....this thing has evolved over a couple of years. One of these days I'll sit down and make it all a bit more concise. But...........there are dozens of these type formulas in the sheet.

Just in case you're curious, it all applies to my business which you can take a look at here: http://www.curvedmouldings.com

BH Davis

5. ## Re: IFODD statement help (Office XP)

Doesn't this simplify it ?(I put all the ORs together since they all give a zero as the result):

Steve

6. ## Re: IFODD statement help (Office XP)

Steve,

Yes, absolutely. However, as I said I have dozens of these formulas that have evolved over the past couple of years in the worksheet. One of these days I'll take the few hours required to bring them all down to a more concise form. In the meantime I'm happy as long as they work.

Thanks for the input,
BH Davis

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•