Formula help needed
Hi guys I need help writing a formula. I'm trying to write a formula in which it calculates the fuel consumption for each truck for that specific date.
What I was trying to say with the formula is that it should look at which truck, date and shift it is today, and then find the same truck and collect the odometer reading that.
So you get the trucks odometer from today minus the odometer reading the same truck filled up the previous time) / the amount of litres from to day.
Sheet
http://app.smartsheet.com/sheets/V8FgF9WM26prxFM4R66RHxcvP62HFJ2RpGVQX7W1
Comments
-
This is my current formula
=(Odometer@row - INDEX(Odometer:Odometer, MATCH(MAX(COLLECT(Date:Date, Date:Date, @cell < Date@row, [Truck No]:[Truck No], [Truck No]@row)), Date:Date, 0), 0)) / Litres@row
But it doesn't seem to be working - I've tried finding the error but I can't.
-
"it doesn't seem to be working"
Is it giving an error or incorrect data?
-
=INDEX(Odometer:Odometer, MATCH(MAX(COLLECT(Date:Date, Date:Date, @cell < Date@row, Truck:Truck, Truck@row)), Date:Date, 0), 0)
So you will see in column 15 the data repeats itself and I don't know how to fix that?
-
I ran it to see which truck's data it was collecting and as you can see in the image its only Truck 14 and Truck 16's odometer readings
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!