+ Reply to Thread
Results 1 to 9 of 9

Help required - formula to check minimum and maximum threshold

  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Smile Help required - formula to check minimum and maximum threshold

    Dear All,

    I have a spreadsheet with Cell A1 being a dropdown to select a currency (GBP, EUR, USD), B1 being a value that is entered by user, C1 being a calculation (=B1*12.5%).

    What I need is a formula (to go in C1) that will check the currency selected in A1 and based on that, check if the calculation in C1 falls within set minimum and maximum thresholds for the currency selected.

    If GBP:
    Min=50
    Max=2000

    If EUR:
    Min=75
    Max=3000

    If USD:
    Min=100
    Max=3500

    So, if the calculation results in a value less than the minimum threshold, then the min value (different depending on currecy selected) should be used and if it is more than the maximum threshold then the max value (again, different depending on currency selected) should be used, otherwise anything in between as dictated by the calculation.

    I hope I have been clear, if not please ask.

    Your help is appreciated, as always.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Help required - formula to check minimum and maximum threshold

    I'm sure there's a better way of doing this, but try this:

    =IF(B1*12.5%<LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),IF(B1*12.5%>LOOKUP(A1,{"EUR","GBP","USD"},{2000,3000,3500}),LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),0))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Help required - formula to check minimum and maximum threshold

    =IF(A1="GBP",MAX(50,MIN(B1,200)),IF(A1="EUR",MAX(75,MIN(B1,300)),IF(A1="USD",MAX(100,MIN(B1,350)),"")))*12.5%
    Try this formula or
    =IF(A1="GBP",MAX(50,MIN(B1*12.5%,200)),IF(A1="EUR",MAX(75,MIN(B1*12.5%,300)),IF(A1="USD",MAX(100,MIN(B1*12.5%,350)),"")))
    Last edited by samba_ravi; 08-18-2014 at 06:34 AM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help required - formula to check minimum and maximum threshold

    i think the max and min are the wrong way around there
    MAX(50,MIN(B1,200))
    should be
    =MIN(200,MAX(50,B1))
    nope it doesnt make a difference my bad
    so maybe
    =IF(B1="","",MAX(LOOKUP(A1,{"eur","gbp","usd"},{75,50,100}),MIN(B1*12.5%,LOOKUP(A1,{"eur","gbp","usd"},{300,200,350}))))
    slightly shorter
    =IF(B1="","",MAX(LOOKUP(A1,{"e","g","u"},{75,50,100}),MIN(B1*12.5%,LOOKUP(A1,{"e","g","u"},{300,200,350}))))
    Last edited by martindwilson; 08-18-2014 at 07:45 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Help required - formula to check minimum and maximum threshold

    Mr martindwilson, may i know Where the formula MAX(50,MIN(B1,200)) will give wrong result

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help required - formula to check minimum and maximum threshold

    read last post!
    it actually is only different if b1 is blank
    Last edited by martindwilson; 08-18-2014 at 07:35 AM.

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Help required - formula to check minimum and maximum threshold

    sorry wrong post
    Last edited by samba_ravi; 08-18-2014 at 07:44 AM.

  8. #8
    Registered User
    Join Date
    11-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help required - formula to check minimum and maximum threshold

    Quote Originally Posted by Special-K View Post
    I'm sure there's a better way of doing this, but try this:

    =IF(B1*12.5%<LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),IF(B1*12.5%>LOOKUP(A1,{"EUR","GBP","USD"},{2000,3000,3500}),LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),0))
    Hi Special-K,

    Thank you very much for this, very helpful indeed.

    I had to make a slight adjustment (I think you were in a bit of a rush so a slight mistake there ) and it worked brilliantly.

    =IF(B1*12.5%<LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),LOOKUP(A1,{"EUR","GBP","USD"},{50,75,100}),IF(B1*12.5%>LOOKUP(A1,{"EUR","GBP","USD"},{2000,3000,3500}),LOOKUP(A1,{"EUR","GBP","USD"},{2000,3000,3500),B1*12.5%))

    Much appreciated

  9. #9
    Registered User
    Join Date
    11-09-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help required - formula to check minimum and maximum threshold

    Quote Originally Posted by nflsales View Post
    =IF(A1="GBP",MAX(50,MIN(B1,200)),IF(A1="EUR",MAX(75,MIN(B1,300)),IF(A1="USD",MAX(100,MIN(B1,350)),"")))*12.5%
    Try this formula or
    =IF(A1="GBP",MAX(50,MIN(B1*12.5%,200)),IF(A1="EUR",MAX(75,MIN(B1*12.5%,300)),IF(A1="USD",MAX(100,MIN(B1*12.5%,350)),"")))
    Hi Siva (?),

    This didn't work, I will play around with it later on if I get a chance.

    Thanks for your help anyway

+ 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. Difficulty adding minimum and maximum values to an existing formula
    By BamaSheet in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-12-2014, 02:01 PM
  2. Formula for Minimum and Maximum amounts
    By kjenkins33 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2013, 10:01 AM
  3. Replies: 4
    Last Post: 10-23-2011, 02:48 AM
  4. Maximum value below a certain threshold.
    By Fishhooky in forum Excel General
    Replies: 4
    Last Post: 09-16-2010, 08:54 AM
  5. Replies: 1
    Last Post: 02-23-2006, 08:30 PM

Tags for this Thread

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