+ Reply to Thread
Results 1 to 4 of 4

Complex IF formula

  1. #1
    Registered User
    Join Date
    05-11-2010
    Location
    Tulsa, OK
    MS-Off Ver
    Excel 2007
    Posts
    9

    Complex IF formula

    Going to try to give some background on the data of this needed formula so that hopefully its clear (as mud?) for whoever is so gracious to help me.

    Nomination = Estimated Gas flow
    Burn = Actual gas flowed
    Imbalance = Nomination minus Burn
    Tolerance = Amount of Imbalance allowed before the shipper has to park/loan the gas

    The formula that I want to create is going to look for the gas outside of the tolerance.

    Here is the tolerance per the contract:
    nomination </= 50,000 = +/- 5,000 tolerance
    nomination > 50,000 = 10% tolerance

    Ex. 1
    Nom = 10,000
    Burn = 6,000
    Imb = 4,000
    Tolerance = +/- 5,000 (because the nomination is less than 50,000)
    Gas outside of tolerance = 0 (Imb < 5000)

    Ex. 2
    Nom = 25,000
    Burn =34,000
    Imb = 9,000
    Tolerance = +/- 5,000 (because the nomination is less than 50,000)
    Gas outside of tolerance = 4,000 (Imb > 5,000, therefore 9,000 minus 5,000)

    Ex. 3
    Nom = 56,000
    Burn = 70,000
    Imb = -14,000
    Tolerance = 10% = 5600 (56,000 * 10%)
    Gas outside of tolerance = -8400 (5600 - 14000)

    Ex. 3
    Nom = 56,000
    Burn = 46000
    Imb = 10,000
    Tolerance = 10% = +/- 5600 (56,000 * 10%)
    Gas outside of tolerance = 4400 (10000 - 5600)

    One issue I see with creating a formula is with the 10% tolerance, because it can be plus or minus the nomination. See the green highlights above.


    Here is a walkthrough of how I envision the formula…
    Nom = Cell Q4
    Burn = Cell R4
    Imb = Cell T4

    IF Q4 <= 50000, then if T4>5000 or T4<-5000, then T26-5000, otherwise 0.
    If Q4 > 50000, then if (0.1*Q4) > T4 or –(0.1*Q4) < T4, then T4 – (0.1*Q4) or (0.1 * Q4) – T4, otherwise 0.

    I’d like this to be just one formula, but if that isn’t at all possible, I can have 2 different formulas.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Complex IF formula

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    03-11-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: Complex IF formula

    Here you go, just need to use the ABS() function to get absolute value.
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Complex IF formula

    Or using only one formula from the two input columns.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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