+ Reply to Thread
Results 1 to 3 of 3

Nested if/or function with three conditions

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Nested if/or function with three conditions

    Hello everyone. Let me start by saying that there's a bit of background information with what I'm doing and what I'm trying to do, so I'll explain the situation the best I can and if something needs to be elaborated on, I can do so.


    What I'm trying to do is create a spreadsheet that will predict the rate of decline of water produced from an oil well in a particular area. When a well first starts pumping, a given amount of water comes out in a day. Over time, the amount of water that comes out decreases gradually, almost like a decay curve. The spreadsheet I'm making will take data from a specific square of land, or township (to be selected from a drop down list), and predict the quantity of water that will be produced on a certain day after a well comes online. This prediction is done by taking two coefficients, A and B, and plugging them into an equation that's specific for that township. Each township has a different value for the A and B coefficients, the values of which are pulled from a different sheet using VLOOKUP after a specific township is selected from the list.


    Most of these townships fit one equation: A + B*ln(0.033) (Let's call it equation 1). The townships that fit this equation I'm going to refer to as group 1.

    Two other townships fit a unique equation: exp(A + B*exp(-.033)) (Equation 2). These will be Group 2 townships.

    And one township fits equation: A/(1+ A*B*0.033) (Equation 3)


    Previously, I only had to work with Groups 1 and 2. This was easy enough, and I had used the cell formula:

    =IF(OR($B$4="17 27N 8W",$B$4="17 28N 8W"),EXP(B8+B9*EXP(-0.033)),B8+B9*LN(0.033))

    Where B4 is the Township name that specifies that if the township selected belongs in Group 2, you would use Equation 2. If otherwise, you would use Equation 1. B8 and B9 are the A and B coefficients, respectively.


    What I would like to do now is add in a third condition that says that if the lone township that fits Equation 3 is selected, that equation will be used instead of the other two. I've tried simply adding in that condition to what I already have, and have also tried to do a simple nested IF function with the three conditions, but I'm always getting an error message that says I have too many arguments. If there is any advice you can give, I'd appreciate it, as I'm not too Excel savvy when it comes to anything beyond simple cell formulas.

    Please let me know if I need to attach any more details and I will do the best I can.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested if/or function with three conditions

    Something like:
    =IF(OR($B$4="17 27N 8W",$B$4="17 28N 8W"),EXP(B8+B9*EXP(-0.033)),IF(OR($B$4="17 27N 9W",$B$4="17 28N 9W"),B8+B9*LN(0.033),B8/1+B8*B9*0.033))

    changing these: $B$4="17 27N 9W",$B$4="17 28N 9W" to suit criteria for 2nd equation
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Nested if/or function with three conditions

    Works like a charm! Thank you so much!

+ 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