If statement error

Posted on 2011-04-18
Last Modified: 2012-05-11
Can you tell me what is wrong with this formula?  
It just states "the formula you typed contains an error"
I think it is a parenthesis but I have tried many combinations to no avail.

=IF(GTExpireDate<FacilityExpirationDate),(SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")))

thank you
Question by:pdvsa
    LVL 51

    Accepted Solution

    looks like you should remove first )

    =IF(GTExpireDate<FacilityExpirationDate),(SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")))


    SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")

    Expert Comment

    try it like this. your brackets were misplaced

    =IF((GTExpireDate<FacilityExpirationDate),SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")
    LVL 50

    Expert Comment

    by:barry houdini
    Not for points....

    Wass7's version should work for you but there's still a redundant pair of parentheses - this should be sufficient

    =IF(GTExpireDate<FacilityExpirationDate,SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")

    regards, barry


    Author Comment

    yes, there was a redudant set of ).  Excel did catch it and I forgot to mention this.  

    thank you.
    LVL 51

    Expert Comment

    looks like I did not see the other )

    =IF(GTExpireDate<FacilityExpirationDate),(SUM(MID($D$15,SEARCH({"mon","day"},$D$15)-3,2)*{30,1}),"Expires After Facility Expiration")))


    "Expires After Facility Expiration"

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now