+ Reply to Thread
Results 1 to 10 of 10

Formula required for calculating mileage total to cost percentages

  1. #1
    Registered User
    Join Date
    04-11-2020
    Location
    London, England
    MS-Off Ver
    Windows 10 64 bit
    Posts
    5

    Formula required for calculating mileage total to cost percentages

    Could someone ell me what is the Excel cell formula would be for calculating total miles x 0.45 up to 10,000 miles and 0.25 miles afterwards so that the calculation for cost auto-changes to 0.25% once the 10,000 miles limit arrives on the spreadsheet and the 0.45 pence no longer applies at 10,001 miles. Surely there is a way of doing this automatically rather than sub-dividing one trip that take you from, say 9,827 miles to 10,002 miles, which may be hard to find if I have a long column of total mileages. Thanks.

    I am starting with cell B6 to input my 06 April total mileage then adding daily mileages each day. I can work out and apply how to do the 0.45 pence bit alone (i.e. =B6*0.45), but not what to write in the code to auto change it from the get
    go at B6 once 10,000 is reached. I 'm trying to avoid manually re-writing the code once I reach 10000 miles because for a high mileage driver that point could be hard to find on the sheet with multiple entries. So could someone write out the whole formulae for me, please so that I can use the same code throughout the spreadsheet.

    Please could i have the solution I ask for, not some variation or suggestion on how to get round the problem doing it crudely or manually or a suggestion that I can just wait until I reach 10,000 miles and sub-divide a trip that might otherwise have take me from 9856-10006 miles = total miles 150. I am only inputting total miles anyway, not trip start and stop mileometer readings, some of which might incorporate private use anyway. I don't do my figures that way.

    Thanks

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Formula required for calculating mileage total to cost percentages

    But … I've given you the working formula in your previous thread: https://www.excelforum.com/excel-pro...-required.html

    Have you checked it?

    Also - have you seen the yellow box at the top of the screen?

    Please look at the file attached
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,844

    Re: Formula required for calculating mileage total to cost percentages

    You are summing from B6 to get total , and each cell represents the total
    =IF( B6 <= 10000 , B6*0.45 , (10000*0.45)+((B6-10000)*0.25) )

    otherwise, if B7, B8 etc is the daily total
    you may need to SUM B6 etc

    =IF( Sum($B$6:B6) <= 10000 , Sum($B$6:B6)*0.45 , (10000*0.45)+((Sum($B$6:B6)-10000)*0.25) )
    and copy down

    you may want to have an blank cells remain blank
    so

    =IF ( B6 ="" , "" , IF( Sum($B$6:B6) <= 10000 , Sum($B$6:B6)*0.45 , (10000*0.45)+((Sum($B$6:B6)-10000)*0.25) ))
    and copy down
    Last edited by etaf; 04-12-2020 at 02:41 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Formula required for calculating mileage total to cost percentages

    PS. As for starting with B6 not B2 in above file:
    Select first row and insert a new one. Repeat 4 more times.

    Look at column C and D. D is at 0.45 pound per mile constant and somewhere around row 20 the results are different. Can you see it?
    Somewhere around, and not exactly at row X, because mileage in column B in attached file are generated as random values.
    Last edited by Kaper; 04-12-2020 at 02:43 PM.

  5. #5
    Registered User
    Join Date
    04-11-2020
    Location
    London, England
    MS-Off Ver
    Windows 10 64 bit
    Posts
    5

    Re: Formula required for calculating mileage total to cost percentages

    HI Kaper,

    Thanks for your help.

    How do i upload my copy worksheet and explain what I am trying to do below.

    I have used another formula from an earlier thread and that works ins terms of calculating from 0.45 ppm and switches to 0.25 ppm after 10,000 miles. But it only works up to a point (for one monthly column) but doesn't progress onto another column (for the next month) which means that the total reverts back to working out a mileage daily figure at 0.45 ppm instead of 0.25 ppm as per the previous column past 10,000 miles. This isn't what I want. Once 10,000 miles has gone, the entire year's worth of months should only now calculate at 0.25 ppm throughout. Therefore the fomulae can't just be copied and inserted at the top of each monthly column, unless linked to a running total instead of a daily mileage column. So I have inserted a running total column now as well.

    Another problem I have which you might help me with. Now that I am inserting a running daily total of miles, i.e., inputting the daily mileage in one column, which should then add previous daily total miles in the column next to it to make a running daily total. E.g., column A is 13/4/2020 = 200 miles (day mileage) = running total for that day = 200 miles. The following day 14/04/2020 is also 200 miles, but the running total for that day should now be 400 miles (adding the day before's total) and so on....I am painstakingly doing a formula for each cell and grabbing the cells in the left (daily mileage) column progressively one by one adding one cell up each time. Is there a quick way of doing this so that I don't have to do each cell separately? It's driving me bonkers. I have a whole year's worth to get through.

    E.g.,

    Column A = Daily mileage,
    Column B = Running Total Mileage (Total mileage from previous days in the same month)

    Again, this needs to progress automatically to the top of the next month's column, not start again, othewise linking the calculation formula to that RT column won't work either.

    I can't believe how hard this is turning out to be.

    Thanks

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Formula required for calculating mileage total to cost percentages

    Please read the yellow banner at the top of the page. Or skip to extended version of it below:

    Will you please attach a SMALL sample Excel workbook(s) (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If there are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, empty cells between data, mixed text/numbers, etc. - please show them all, or at least indicate in text). The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution(s) is/are also shown (mock up the results manually).

    3. Make sure that all confidential/restricted information (either personal or business) like real e-mails, social security numbers, bank accounts, etc. is removed first!!

    To attach an Excel file you have to do the following (paperclip icon does not work!): Just before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.

  7. #7
    Registered User
    Join Date
    04-11-2020
    Location
    London, England
    MS-Off Ver
    Windows 10 64 bit
    Posts
    5

    Re: Formula required for calculating mileage total to cost percentages

    HI, here is the worksheet. Thanks
    Attached Files Attached Files

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Formula required for calculating mileage total to cost percentages

    OK, as you have a running total, the formulas are shorter. so G6:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down
    (note that I added the IF part, to hide repeating total down to the bottom of the table when a cell with mileage is empty)

    Then H6 using the same concept as in posts above, but utilizing already calculated running total, and again IF to hide Ł0.0
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down

    Then at the total line in F and H columns - sums, while in G37:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    These 3 cells (F37:G37 can be directly copied into next columns, so M37:O37, T37:V37 etc.

    The formulas for row 6 in next month have to be a bit modified, to include also information from previous one, so in N6 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And in O6 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The later one could be shorter -
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    but having this extended version, we can copy this 2 columns to next month (N6:O36 copied to U6:V36), and next and so on.

    Enjoy!
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-11-2020
    Location
    London, England
    MS-Off Ver
    Windows 10 64 bit
    Posts
    5

    Re: Formula required for calculating mileage total to cost percentages

    HI, that's great Kaper. I have seen how it all works together and now it is all fine - for business mileage.

    How do I replicate the same for each of the other categories (1) Car Hire columns x each month and then (2) Private Use columns x each month (just as you have for the Business Mileage category you did for me. Each category running independently of each other for daily mileage, running totals and cost, but each category linked month to month (exactly as you did for Bus Mileage).

    I have not put the running total column in each of the title bars yet, but want to replicate the same for these too.
    Hope that makes sense.

    When I copied the formula across from Business Mileage to each one for April and May it didn't seem to work that well.

    Maybe I copied it across wrong. Or should I just enter the formula myself for each of these categories rather than copy it across?

    Thanks
    Last edited by BG0612; 04-15-2020 at 05:45 PM.

  10. #10
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Formula required for calculating mileage total to cost percentages

    just copied formulas from R and S to L and M.
    While L is immediately ready, M shall be edited, because the formula there sums up all values from previous columns with cost in header. And here we are interested in cost of hire - so the header "Cost" is in row 3 - not 5 as for cost associated with business.
    The amended M6 is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If doing the same operation for private - note the headers will be in Row 4
    Attached Files Attached Files

+ 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. Calculating total dollars and percentages by job
    By filly_05 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-13-2013, 02:24 PM
  2. [SOLVED] Calculating commissions with varying percentages based on running total
    By morgan74 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2013, 01:04 AM
  3. Calculating total cost from range of cell tally's by cost of item.
    By patrickdjames in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 11-04-2012, 10:27 AM
  4. Replies: 3
    Last Post: 03-16-2010, 01:26 PM
  5. Calculating total from number of minutes and cost p/m
    By Macey141 in forum Excel General
    Replies: 2
    Last Post: 08-06-2009, 05:44 AM
  6. Formula For Total Cost of Increasing Item Cost
    By dwax in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-05-2009, 01:10 PM
  7. Calculating cost from known percentages
    By alan01feb in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-24-2006, 07:52 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