# Read from row above

**URL:** <https://community.glideapps.com/t/read-from-row-above/16442>\
**Category:** Ask for Help\
**Created:** [September 28, 2020, 10:04am UTC](https://community.glideapps.com/t/read-from-row-above/16442 "2020-09-28T10:04:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steffen\_Walz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steffen_walz/32/14325_2.png) [@Steffen\_Walz](https://community.glideapps.com/u/Steffen_Walz)\
**Post date:** [September 28, 2020, 10:04am UTC](https://community.glideapps.com/t/read-from-row-above/16442/1 "2020-09-28T10:04:24Z")

</div>

Hi Gliders, I made a petrol usage app. It’s pretty cool, but you always have to enter the old and the new km in order to calculate how far you have driven to then calculate the usage per 100km. I have search for a long time now but I can’t find a way to get the value of another column in the row above the current row. Is there a way? Cheers, steffen

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 28, 2020, 10:08am UTC](https://community.glideapps.com/t/read-from-row-above/16442/2 "2020-09-28T10:08:10Z")

</div>

I imagine you can have a setup like this:

- In Sheets: a numerical order column that returns the record number of your petrol usage submission.

- In Editor: a math column to return the “row above number”. Current row number - 1. Then a relation from the math column to the numerical order column. From that, you can return the columns you want using lookup.

---

<div class="post-metadata">

**Author:** ![Steffen\_Walz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steffen_walz/32/14325_2.png) [@Steffen\_Walz](https://community.glideapps.com/u/Steffen_Walz)\
**Post date:** [September 28, 2020, 10:31am UTC](https://community.glideapps.com/t/read-from-row-above/16442/3 "2020-09-28T10:31:39Z")

</div>

> [@ThinhDinh](#):
>
> =ARRAYFORMULA(IF(A2:A\<\>“”,ROW(A2:A)-1,“”))

Wow, that is pretty bloody fantastic mate! I got it!! Thanks so much. I need to do more with Glide, it’s so cool!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 28, 2020, 10:43am UTC](https://community.glideapps.com/t/read-from-row-above/16442/4 "2020-09-28T10:43:12Z")

</div>

Let us know if we can help more mate. Have a nice week!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 28, 2020, 10:44am UTC](https://community.glideapps.com/t/read-from-row-above/16442/5 "2020-09-28T10:44:09Z")

</div>

Also, if you’re not familiar with arrayformula, I wrote a post here 😄

[Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727)
