Help

Re: Vehicle Fuel Log - calculating miles driven between fill ups and MPG

2220 1
cancel
Showing results for 
Search instead for 
Did you mean: 
petebocken
5 - Automation Enthusiast
5 - Automation Enthusiast

I’m creating a vehicle fuel log. I’d like to calculate the miles driven between fill ups (trip). After that, then I will be able to easily calculate the miles-per-gallon (MPG).

I know I could easily accomplish this by adding a column for “start odometer” and “end odometer” and then simply subtract the two numbers. But that is extra work each time I create a new entry. I’d rather just add the odometer reading at the time of the fill up and have it auto-calc based on the previous (above) entry’s odometer field. I know that since Airtable is not just a spreadsheet you can’t do what you’d do in Excel with something like “=sum(b2-b1)”. Also since the sort order could change, etc.

So I was thinking, what if I setup an auto-increment ID, that way I can reference to the previous ID’s odometer field. Since the previous ID would be one less than the current, that would work, unless I delete an entry. So that may not be the best option.

Is this possible or am I just stuck with manually typing the “end odometer” and copying it to the “start odometer”?

Screen Shot 2022-04-30 at 12.29.11

12 Replies 12

I don’t think this is about consumer mileage. More likely a fleet of trucks or something.

petebocken
5 - Automation Enthusiast
5 - Automation Enthusiast

@kuovonne Your implementation works perfect! Also thanks @ScottWorld That works too, but I definitely wanted to keep the date as the primary field.

Also thanks @kuovonne and @Bill.French for noting the use cases. They all apply for me.

I’ve actually been using Road Trip (Road Trip for iPhone and iPad - darrensoft.ca) for many years and it’s worked perfectly fine. However, as was mentioned, there are a few reasons for wanting to move this into Airtable:

  • Full control/Owning my data (Road Trip actually lets you export everything to csv and even automatically), but I still like the idea of having this in Airtable
  • Logging other things: I log my service records in Road Trip as well, but how it handles it’s text fields isn’t as nice as Airtable
  • Accessible on my Mac: Road Trip is iOS only (at least for now) I have an M1, so it’s possible it could become available on macOS, but so far running iOS apps on Mac hasn’t been super useful in most cases.
  • I already have so much other data in Airtable, moving this into a centralized location is attractive.

@Bill.French LOL, no fleet of trucks here, literally just a 2011 Equinox and a Tesla. Which is the other reason why Road Trip is actually not used that much anymore since our daily driver is the Tesla, which I have connected to TeslaMate (GitHub - adriankumpf/teslamate: A self-hosted data logger for your Tesla 🚘), so all it’s data is automatically recorded for me. I just record service logs, which in the two years we’ve had the Tesla haven’t been much obviously!

The Equinox isn’t driven that much, so I’m not entering fuel logs that much either.

I was gonna’ say - just get a Tesla and automate this end-to-end, but I figured that was presumptuous. The best part is no part at all.