How to calculate using values from other row

Hello everyone,
Currently, I am working on creating a fuel consumption management app.
The data is a Google Spreadsheet with the following table structure:

  • Date and Time
  • Model Name
  • Value of ODOMETER
  • Amount of Fuel Refueled

Using this table, I aim to:

  1. Calculate the distance traveled from the last refueling to the current refueling.
  2. Compute fuel efficiency by dividing the distance traveled by the amount of fuel refueled.

While I have successfully retrieved the distance traveled at the last refueling using the Query column, I encountered difficulties using that value in the Math column for further calculations.

Could someone guide me on how to achieve these calculations? I appreciate any assistance or insights you can provide.

Thank you in advance!

If you’re using a lookup to retrieve the value from the Query, try using single value. Lookups from Queries always return arrays which can’t be used in Math

3 Likes

I wanted to express my sincere gratitude for the prompt and helpful responses to my recent inquiry. With your guidance, I was able to successfully implement the calculations.
Thank you !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.