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
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 59 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!