+ Reply to Thread
Results 1 to 5 of 5

Is it not possibe to insert an IF(AND..-formula into an IF(OR.-formula?

  1. #1
    Registered User
    Join Date
    05-03-2006
    Location
    Mellerud, Sweden
    MS-Off Ver
    2016
    Posts
    70

    Is it not possibe to insert an IF(AND..-formula into an IF(OR.-formula?

    Usually, when I horse around with different combinations of the IF(AND...-formulae, it's just a matter of patience and time before they click into place. Not this time.
    I may have overlooked a parenthesis or slipped a tab or something, but the error message seems somewhat coincendental in its highlighting of places in the formula - now here, now there. Although I have quite a few functioning combinations of these (some of them ridiculously long), they are confined to the pure IF- and IF(AND-variety. So they may not be meant to be combined in the way I tried. Thought I'd ask here before I dive into the mass of combinations I already have.

    First I cut the AND-part from an IF(AND(OR-formula, like this one
    =IF(AND(B69=10;OR(C69=5;D69=2));1;0)
    into something like this -
    =IF(OR(DM2827=5;DO2827=7;DP2827=9);1;0)
    - to seek out a range where just one out of many conditions are met. Works fine as such.
    The trouble starts when I try to replace one of the "sub-conditions", the DM2827=5, for instance, with an IF(AND-formula.
    Something like this:
    =IF(OR(IF(AND(DI2822<DI2821;DF2822>DF2821);(IF(AND(DI2822<DF2821;DF2822>DI2821);1;0)))
    This one would've served it's purpose perfectly, if it would only work. Does anybody know what's wrong with it - or if it's at all possible?

    Thanks in advance
    BCB
    Last edited by BCB; 11-05-2008 at 02:19 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    You don't need the internal IF's and shuffling your parentheses;
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-03-2006
    Location
    Mellerud, Sweden
    MS-Off Ver
    2016
    Posts
    70
    Hello
    I'm afraid not: the same error messages pops up (regarding lack of or misplaced parentheses). Appreciate your efforts, though.
    I'll try to get around the problem by a combination of the IF-formulae I already have, and find some way of putting the alternative case formula in the "0"/"FALSE" part. I vaguely remember a way of doing something like this a while ago; I just hoped the formula above - if functioning - might be a short cut.
    Thanks anyway

    BCB

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    if you want to replace DM2827=5 in
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    it needs to look like this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-03-2006
    Location
    Mellerud, Sweden
    MS-Off Ver
    2016
    Posts
    70
    Thank you!
    This one seems to do the trick. At least it returns the 1 or 0 (depending on conditions I have not yet sorted out).
    Now remains the tricky part of brain working alone, with sorting out the numerous conditions. A few decisions to make..
    But once having done that, this formula will be very useful, and save me some time as well as space in the sheet.
    Thanks again.
    BCB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1