+ Reply to Thread
Results 1 to 6 of 6

IF, MIN, MAX assistance

  1. #1
    Registered User
    Join Date
    10-30-2014
    Location
    MN
    MS-Off Ver
    2010
    Posts
    5

    IF, MIN, MAX assistance

    I've been working too much and everything is running together. I got 1 equation to work flawlessly, but the second is throwing me off and it's just not working 100% correct.

    Here's the one that works. It requires information to be pulled from 1 cell to get the answer:
    =IF(D2<21,0,(TRUNC((MIN(D2,50)*0.001+MAX(MIN(D2-70,50),0)*0.001/2+MAX(MIN(D2-120,80),0)*0.001/4),3)))


    I can't get the one that's giving me troubles to work 100%, it requires information from 2 cells and the equation needs to work like such:
    IF (cell < 30) = 0
    31 thru 130 = *.001/2
    131 thru 200 = *.001/4
    results must truncate after the 3rd decimal spot (thousandths) and regardless of the amounts entered into the cells, the max result that can be returned is .067

    30 thru 130 (100 max) * .001/2) = .05
    131 thru 200 = (70 max)*.001/4 = .017
    The max result can only be .067

    Here's what I've come to ending up with, and it's not quite working correctly:
    =IF(D5<31,0,(TRUNC((MIN((D5+D3)-30,100)*0.001/2+MAX(MIN((D5+D3)-130),0)*0.001/4),3)))

    Entering data above 200 total combined points should still only return the max result of .067. Like for the working equation (first one posted), the max return result is .095 and any number entered in above 200 still only returns the max result of .095.

    What am I missing in the second one to keep the max result from being exceeded? I've attached the worksheet I've been playing in. Hopefully someone can help me out here and hopefully I've explained this well enough to follow.

    Oh, and if there's an easier way to do this, I'm all ears.

    testing.xlsx

    Thanks.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: IF, MIN, MAX assistance

    Without looking at your sheet, just try

    =MIN(0.67,IF(D5<31,0,(TRUNC((MIN((D5+D3)-30,100)*0.001/2+MAX(MIN((D5+D3)-130),0)*0.001/4),3))))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    10-30-2014
    Location
    MN
    MS-Off Ver
    2010
    Posts
    5

    Re: IF, MIN, MAX assistance

    I gave it a try, but it still returns the same results. Once D5+D2 go over 200, the result keeps increasing instead of being stopped at the cap.

    I'm going to give my bran a rest from all the numbers and play with it some more later.

    Thanks for the suggestion, just didn't work for me.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: IF, MIN, MAX assistance

    Here's what I come up with

    =MIN(0.067,D5*LOOKUP(D5, {0,31,131}, {0,0.0005,0.00025}))

    Update to truncate at 0.001

    =MIN(0.067,TRUNC(D5*LOOKUP(D5, {0,31,131}, {0,0.0005,0.00025}), 3))
    Last edited by ChemistB; 09-15-2015 at 04:47 PM.
    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

  5. #5
    Registered User
    Join Date
    04-17-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    21

    Re: IF, MIN, MAX assistance

    This stops it at .05 which is what would happen if both minimums were met (100, 0)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I would personally do it like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-30-2014
    Location
    MN
    MS-Off Ver
    2010
    Posts
    5

    Re: IF, MIN, MAX assistance

    Quote Originally Posted by thebellguy View Post
    This stops it at .05 which is what would happen if both minimums were met (100, 0)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I would personally do it like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Nice. This is easier to follow and does the job. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need assistance
    By lihkin in forum Excel General
    Replies: 4
    Last Post: 10-27-2011, 01:01 PM
  2. Need some assistance
    By CO1966 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2008, 07:41 PM
  3. Need Assistance With This
    By alexm999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2007, 05:46 PM
  4. =IF(AND) ASSISTANCE
    By VAN GOGH in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-20-2006, 11:20 PM
  5. Assistance please?
    By Anne Troy in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 04:05 AM
  6. [SOLVED] Assistance please?
    By http:// in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. Assistance please?
    By http:// in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-06-2005, 04:05 PM
  8. Need some assistance
    By N Schei in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-24-2005, 04:06 PM

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