+ Reply to Thread
Results 1 to 6 of 6

Add an amount to a cell if the value of one of the conditions is greater than X

  1. #1
    Registered User
    Join Date
    03-17-2019
    Location
    Portugal
    MS-Off Ver
    Office 2008 for Mac
    Posts
    5

    Add an amount to a cell if the value of one of the conditions is greater than X

    OK, sorry to test your patience again.

    So far I have come to this formula which is working:

    =MAX(CEILING (((E3*$AG$2*$AD$2)+(F3*2))*$AF$2;5);50)

    In this case:

    E3 is the number of kms
    $AG$2 is the return kms factor
    $AD$2 is the cost per mile

    F3 is the cost of tolls (x 2 for the return trip)

    $AF$2 is the cost of VAT TAX

    5 is the round up value.

    50 is the minimum price

    Now, I want to add the following condition: If a trip (considering the return) exceeds X number of kms, the cost of a driver's meal must be included.

    In this case, if a one way trip (E3 cell) exceeds 275 kms, then the cost in the $AH$2 cell must be added to the calculation BEFORE VAT. If the one way trip is less than 275 kms, then no cost (or zero cost) should be added.

    I assume this involves the use of the IF function, but, can you help with this?

    Thank you.
    Last edited by execlass2; 03-17-2019 at 12:49 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,573

    Re: Add an amount to a cell if the value of one of the conditions is greater than X

    So how would you calculate the length of the journey? Is it E3+AG2?

    Whatever it is, try this:

    =MAX(CEILING (((E3*$AG$2*$AD$2)+IF(Total_km <= 275; 0; AH2)+(F3*2))*$AF$2;5);50)
    Last edited by AliGW; 03-17-2019 at 01:07 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-17-2019
    Location
    Portugal
    MS-Off Ver
    Office 2008 for Mac
    Posts
    5

    Re: Add an amount to a cell if the value of one of the conditions is greater than X

    [QUOTE=AliGW;5084839]So how would you calculate the length of the journey? Is it E3+AG2?

    Dear Ali,

    The length of the journey is calculated by E3 * $AG$2 (in this case, the value of AG2 is 2,02, in which 2 represents the return trip and ,02 is an average of extra kms from the town center to any given site in the surroundings)

    In any case, the value of E3 is enough for the calculation. If E3 exceeds 275 kms (thus, a total return trip of 555,5 kms, which means a trip with more than 4 1/2 hours), then add the value of a meal in $AH$2. If less than 275, then add zero (or do nothing).

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,573

    Re: Add an amount to a cell if the value of one of the conditions is greater than X

    So this then:

    =MAX(CEILING (((E3*$AG$2*$AD$2)+IF((E3*$AG$2) <= 275; 0; AH2)+(F3*2))*$AF$2;5);50)

  5. #5
    Registered User
    Join Date
    03-17-2019
    Location
    Portugal
    MS-Off Ver
    Office 2008 for Mac
    Posts
    5

    Re: Add an amount to a cell if the value of one of the conditions is greater than X

    Dear Ali,

    It works! I had to modify it a little:

    =MAX(CEILING (((E3*$AG$2*$AD$2)+IF((E3*$AG$2) <= 550; 0; $AH$2)+(F3*2))*$AF$2;5);50)

    But yeah, it's working!

    Thank you so much You rock.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,573

    Re: Add an amount to a cell if the value of one of the conditions is greater than X

    Great!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] list of names and amount where amount greater than zero
    By santbiju in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2016, 10:49 AM
  2. [SOLVED] Select Only If No Other Cell is Greater Than X and All Other Conditions are Met
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-05-2015, 08:24 PM
  3. Identifing the greater of two cell by a speciffic amount
    By sgmgrider in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-21-2015, 03:56 PM
  4. Replies: 3
    Last Post: 07-03-2013, 10:43 AM
  5. [SOLVED] Identify a Cell When a Following Cell is a Certain Value Amount Greater
    By SKIPPER7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 12:15 PM
  6. Need help with a Greater than Formula by a Certain Amount on a cell
    By wallstreetballa in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-22-2012, 03:08 AM
  7. Replies: 3
    Last Post: 10-22-2009, 07:20 AM

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