• Expand IF statement (2003)

    Author
    Topic
    #449916

    Greetings,

    I have the following formula (which works): =IF(AW2=”Incorporated”,DE2-HV2+1,IF(DE2=””,IF(HV2=””,””,TODAY()-HV2),DE2-HV2+1))

    Now, I tried the following (which DOES NOT function)

    =IF(AW2=”Incorporated”,IF(DC=”Change Cancelled”,IF(DC=”Change Rejected”,DE2-HV2+1,IF(DE2=””,IF(HV2=””,””,TODAY()-HV2),DE2-HV2+1))))

    Columns AW and DC are always text

    DE and HV are always dates

    Any Ideas?

    Thanks,
    Brad

    Viewing 0 reply threads
    Author
    Replies
    • #1104313

      What is DC? A defined name? It is not a reference to a cell since there is no row number.

      The formula makes no sense because if DC (whatever it means) is equal to “Change Cancelled”, it cannot be equal to “Change Rejected”.

      Could you try to explain what the formula should do?

      • #1104316

        Oops..

        should have stated DC2. DC2 could contain Change Cancelled, Change Rejected, Change Approved.

        The expectation is as follows

        IF the contents of AW2 = Incorporated, or if the contents of DC2 is Change Cancelled or Change Rejected then DE2-HV2+1, else if DE2= blank, of if HV2 =blank, then today-HV2 else DE2-HV2+1

        Now, without the extra check for Change Cancelled and Change Rejected the formula works.

        However I need the additional check so that the resultant number is correct.

        The number returned is a count of days in whole numbers. Because of the data, the extra check is necessary to get the Real numbers.

        Brad

        • #1104318

          The solution is in the way you state the condition: you should use the OR function

          =IF(OR(AW2=”Incorporated”,DC2=”Change Cancelled”,DC2=”Change Rejected”),DE2-HV2+1,IF(DE2=””,IF(HV2=””,””,TODAY()-HV2),DE2-HV2+1))

          • #1104319

            Wonderful….

            misplaced the OR function…..

            banging my head now.

            Thks,
            Brad

    Viewing 0 reply threads
    Reply To: Expand IF statement (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: