+ Reply to Thread
Results 1 to 10 of 10

formula for mileage - various rates

  1. #1
    Registered User
    Join Date
    11-19-2019
    Location
    dublin
    MS-Off Ver
    365
    Posts
    4

    formula for mileage - various rates

    Hi

    I'm trying to do a mileage expense formula based on the following (i'm not sure if my attachment will load up)

    Km cent

    Rate 1 0 - 1500 44.79
    Rate 2 1501 - 5500 83.53
    Rate 3 5501 - 25000 32.21
    Rate 4 25001 - 25.85


    Total Mileage to date 9500



    Can anyone help with a formula. I'm guessing it's an IF formula rather than a vlookup?
    Attached Files Attached Files

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

    Re: formula for mileage - various rates

    could you explain a bit more as to how your mileage is supposed to work? Is it that for 9500 the first 1500 goes at 44.79 (1500*44.79=67185), then you take the next 3500 (5000-1500) and multiply that by 83.53 and add the 671.85 (3500*83.53=292355) then the rest, 4500 (9500-5000) goes to the 32.21 (which is 144945) and add all three together (504485 cents)?
    What should the total be?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    11-19-2019
    Location
    dublin
    MS-Off Ver
    365
    Posts
    4

    Re: formula for mileage - various rates

    Hi Sambo kid yes that's how it's calculated

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

    Re: formula for mileage - various rates

    you didn't answer what the answer should be for 9500.

    That would be a help.

  5. #5
    Registered User
    Join Date
    11-19-2019
    Location
    dublin
    MS-Off Ver
    365
    Posts
    4

    Re: formula for mileage - various rates

    Quote Originally Posted by Sambo kid View Post
    you didn't answer what the answer should be for 9500.

    That would be a help.
    I can do three individual formulas and am getting the same answer as you €5,044.34 (euros rather than cents) but I'm trying to figure out how I do one formula instead of three separate ones and adding them together (much like your calculations).

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,451

    Re: formula for mileage - various rates

    Try setting up like this


    A
    B
    C
    D
    E
    F
    2
    KM
    cent
    3
    band 1
    0
    1500
    44.79
    44.79
    In E3 and filled down =D3-N(D2)
    4
    band 2
    1501
    5000
    83.53
    38.74
    5
    band 3
    5001
    25000
    32.21
    -51.32
    6
    band 4
    25001
    200000
    25.85
    -6.36


    Then in D14

    C
    D
    E
    13
    total km
    9500
    14
    Total expenses
    € 5,044.98
    =SUMPRODUCT((D13>B3:B6)*(D13-B3:B6)*E3:E6)/100
    Dave

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,451

    Re: formula for mileage - various rates

    This site might help you with tiered calculations.

    http://www.mcgimpsey.com/excel/variablerate1.html

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

    Re: formula for mileage - various rates

    Dave, glad you got it, I've been playing with it for over an hour but not getting it with sumproduct. I was going to set up a column like you did in E but the negatives kept messing with my head.
    Kudos to you.
    Last edited by Sam Capricci; 11-19-2019 at 07:21 PM.

  9. #9
    Registered User
    Join Date
    11-19-2019
    Location
    dublin
    MS-Off Ver
    365
    Posts
    4
    Quote Originally Posted by Sambo kid View Post
    FlameRetired, glad you got it, I've been playing with it for over an hour but not getting it with sumproduct. I was going to set up a column like you did in E but the negatives kept messing with my head.
    Kudos to you.

    Guys thanks so much for your help. I’m going to have to sit down and digest that and thanks for the link I feel I’m a bit out of my depth

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,451

    Re: formula for mileage - various rates

    Quote Originally Posted by Sambo kid View Post
    Dave, glad you got it, I've been playing with it for over an hour but not getting it with sumproduct. I was going to set up a column like you did in E but the negatives kept messing with my head.
    Kudos to you.
    LOL. Me, too. At first glance it makes no sense ... but then gradually.
    Oh yes; thanks for the Kudos, feedback and rep.

+ 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. Replies: 3
    Last Post: 12-08-2020, 12:22 PM
  2. [SOLVED] Help with creating excel spreadsheet for calculating mileage with multiple rates
    By Annahstar in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-29-2016, 01:18 PM
  3. Calculate Mileage Based on 2 Rates
    By jbondbmw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-17-2014, 09:21 PM
  4. Formula for HMRC Mileage rates
    By Jinky_uk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2013, 01:04 PM
  5. [SOLVED] Mileage Log and Reimbursement Form with Split rates
    By robiniwitz in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-28-2012, 02:26 PM
  6. Using a formula to calcualte different mileage rates
    By andrewf in forum Excel General
    Replies: 2
    Last Post: 01-17-2012, 11:59 AM
  7. service invoice for parts, tax, two labor rates,mileage inventory.
    By T&M Petro Mike B. in forum Excel General
    Replies: 0
    Last Post: 01-19-2005, 12:06 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