+ Reply to Thread
Results 1 to 13 of 13

Caculate fuel consumption in datasheet with mutiple vehicles.

  1. #1
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Caculate fuel consumption in datasheet with mutiple vehicles.

    Because I am ne I might ask a question that was delt with:
    In my fuel records the liters fuel used and kilometer readings are recorded.
    The sheet includes records for 20 or more different machines and they refuel ierregularly.
    Now I want to caculate fuel consumption for the last tank, average for this vehicle and average for this tipe of vehicle.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    Hi Louis en welkom ann die dorum

    Im sure we can work something out that will suite your needs, but it will help if we could see what you are working with

    I would suggest that you upload a sample workbook, showing what data you are working with (remove any sensitive info), show a few samples of what your expected outcome would be, and how you arrived at that.

    (I grew up in SA, worked on the gold mines near Klerksdorp)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    FDibbins
    Thanks for reaction. The data is simple. Each record contains a fuel record for a vehicle with kilo reading and liters fuel. This record is followed up with such a record of another vehicle. And much more. After 2 days and 20 or so record comes a record for the same vehicle with kilo reading and liter fuel again.
    To caculate consumption you wil have to find the previous record to get the previous kilo reading. Subtract the two kilo readings from each other and devide by liters.
    My problem is the formule to find the previous record of the same vehicle in a datasheet sorted on date and time.
    Thanks

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    This is an easy task in Access. I have an Access template that I developed to do this for a friend a while back that I would share with you if this is a direction you would be willing to go. If you don't have Access installed, then you can get you a copy of Access Runtime (free from Microsoft) that will allow you to use the program without Access installed.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    If alan's suggestion doesnt work for you, I say again, please upload a sample workbook for me to look at

  6. #6
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    Access is a possibillity but excel would be first choice. I do have access on my computer but my workers do not have it. If I can get a option to run it on the other 4 computers it would be nice.
    I do not know how to attach a file????

  7. #7
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    I tink I have attached it!!
    Attached Files Attached Files

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    Download Access Runtime fro this site: http://www.microsoft.com/en-us/downl...s.aspx?id=4438

    Here is a copy of the db with some data in it. Play with it and if you decide to use it, then make sure you delete the sample data, run a compact and repair and then begin loading your data.

    Read this about the installation and use of runtime: http://www.hitechcoach.com/

    And finally, the file is attached in a zip file.
    Attached Files Attached Files

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    When I opened your file, I found no headers and did not know what each column represented. In addition, I received a circular error and some broken links in columns R, S and T which resulted in #REF in the formulae.

    Alan

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    Hi Louis, I think you left off the headings and some sheets or something?

    and the circular error mentioned by alan seems to confirm this. in S1, you have...=IF(I1=S$1,IF(G1="TtB",#REF!+N1,#REF!-N1),#REF!). The other #REF's may not matter, but if this is 11 of many other sheets, and you deleted the other sheets before sending, maybe copy/paste values on those referencing columns before you delete the other sheets?

  11. #11
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    I attached the file again. Please ignore everything else. Look at any record of as vehicle and find the previous record for the same vehicle. The reading for Hour or Kilometer must be use to be deducted from the current record to get the kilometer runned.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    I found the next solution for this problem on different sites but it does not work for me:
    =lookup(2,1/(A2:A9=D2),B2:B9)
    The result is no calculation.

  13. #13
    Registered User
    Join Date
    01-27-2013
    Location
    Kuurman, South Africa
    MS-Off Ver
    Excel 2016 Professional
    Posts
    17

    Re: Caculate fuel consumption in datasheet with mutiple vehicles.

    I have redone the previous formule and it worked. My data is nog good enough but I will fix that.
    Thanks for the help. I am closing this now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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