Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    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. #2
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IFODD statement help (Office XP)

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

    (not) stuck

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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. #4
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    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.


    =IF(AND(C14="QUARTER ROUND",ISODD(D27)),(180/D27)/4,IF(OR(J17="JAMB",C14="NON RADIUS",C14="STRAIGHTS"),0,IF(C12="",0,IF(OR(C14=" ELLIPTICAL",C14="SERPENTINE"),0,IF(C14="OVAL",0,AA 23)))))

    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

    Thanks again for your help,
    BH Davis

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    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):

    =IF(AND(C14="QUARTER ROUND",ISODD(D27)),180/D27/4,IF(OR(J17="JAMB",C14="NON RADIUS",C14="STRAIGHTS",C12="",C14="ELLIPTICAL",C1 4="SERPENTINE",C14="OVAL"),0,AA23))

    Steve

  6. #6
    3 Star Lounger
    Join Date
    Jan 2002
    Location
    CT
    Posts
    361
    Thanks
    0
    Thanked 1 Time in 1 Post

    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
  •