+ Reply to Thread
Results 1 to 5 of 5

Calculate Limit Value Formula

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Calculate Limit Value Formula

    All,

    I'm having a little trouble with the logic on this one. Consider the following simple example. Say my car gets 20mpg, I have a 15g tank, and I have a requirement to drive 100miles.

    I want to write a formula that can dynamically calculate how many miles I can drive without running out of gas (up to my 100 mile requirement).

    The formula would either result in the 1) total requirement of 100 miles or the 2) maximum number of miles I can drive until i run out of gas (if less than 100 miles).

    So, if the fuel burned over the course of 100 miles is less than my 15g tank, then 100 miles is returned, otherwise return maximum number of miles I can drive until i run out of gas.

    Thanks in advance.

    Best,
    Chris

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Calculate Limit Value Formula

    so let's say A1 has the 20 in it and B1 has the 15 for your tank size, then if I'm understanding you correctly this should work for you in C1 =IF(B1*A1<100,100,B1*A1)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    12-15-2019
    Location
    Not here
    MS-Off Ver
    2010
    Posts
    257

    Re: Calculate Limit Value Formula

    300 miles per tank which is the mpg multiplied by the gallons in each tank.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate Limit Value Formula

    ...another approach with A1 = mpg 20, A2 = tank capacity 15, A3 journey mileage = 100

    Maximum mileage:

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    10-14-2015
    Location
    East Coast
    MS-Off Ver
    2013
    Posts
    69

    Re: Calculate Limit Value Formula

    All, thank you for the thoughtful responses. Richard's and Sambo's solution worked great. I've ran into another problem - but would probably warrant another thread, kind of unrelated from this issue. Thanks again.

+ 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. Quality Control Upper Limit-Lower Limit Pass/Fail
    By vedaty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2019, 03:55 PM
  2. Replies: 1
    Last Post: 08-17-2019, 01:26 PM
  3. Copy and insert row below within fixed upper limit and dynamic lower limit
    By droffel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2015, 08:57 PM
  4. [SOLVED] Formula to calculate monthly SS FICA tax with wage base limit
    By randiesq in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-11-2013, 06:48 PM
  5. [SOLVED] find the lower and upper limit if data is in between on that limit
    By clangeles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-27-2012, 06:18 AM
  6. Replies: 1
    Last Post: 01-13-2011, 02:29 PM
  7. How to limit 'calculate' (F9) to specific cell, range, sheets, workbooks?
    By pm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2006, 04:55 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