# Data calculate in Data editor to Gsheets

**URL:** https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735
**Category:** Ask for Help
**Created:** [June 12, 2020, 3:29pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735 "2020-06-12T15:29:46Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![ced285](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ced285/32/9002_2.png) [@ced285](https://community.glideapps.com/u/ced285)
#### Post date: [June 12, 2020, 3:29pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/1 "2020-06-12T15:29:46Z")

</div>

Hello Glide community.

It is quite easy to retrieve data from Google sheets in the GLIDE data editor to calculate formulas, make relationships, etc.

However, is it possible to do the opposite, namely to recover calculated data from the glide data editor (therefore not visible in google sheets) in Google sheets?

Thank you  
Ced285

---

<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: [June 12, 2020, 3:32pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/2 "2020-06-12T15:32:35Z")

</div>

One workaround for this is to use the “Columns” component in the form button, that would write values from the previous screen to your sheet.

---

<div class="post-metadata">

### Author: ![ced285](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ced285/32/9002_2.png) [@ced285](https://community.glideapps.com/u/ced285)
#### Post date: [June 12, 2020, 4:34pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/3 "2020-06-12T16:34:11Z")

</div>

Thank you for that answer. if I take the example of the form again, I would have to be able to record the validation date of the form in 2 different sheets … this does not seem possible to me, I only have the choice of one sheet?

---

<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: [June 12, 2020, 4:46pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/4 "2020-06-12T16:46:45Z")

</div>

Can you describe in more details your data flow in the app and what you want to record in the sheet? Thank you.

---

<div class="post-metadata">

### Author: ![ced285](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ced285/32/9002_2.png) [@ced285](https://community.glideapps.com/u/ced285)
#### Post date: [June 12, 2020, 5:21pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/5 "2020-06-12T17:21:37Z")

</div>

Well, I didn’t want to go into too much detail so as not to be confused …  
I will try to be synthetic.

I have 2 sheets to manage climbing equipment.

1 sheet with all of the material, each material having a unique identifier: material

1 other sheet linked to a form which serves as a history for the verification. Historic

In the sheet which centralizes all the equipment, I made a relation thanks to the glide editor with the “historic” file and a rollup to determine the date of the last verification (special value in form \> date) for each equipment of the material file.

Only, this value (last check) does not appear in my Gsheets because it remains in the Glide editor. I want to export to Word with this “material” sheet to automatically generate 1 sheet per material … and I need this date of last verification. It is present under glide but not in Gsheets … hence my first remark.

I explored the arrayformula function to go only through sheets, but I can’t get it to work with the maxif function. (maximum dates for each material identifier)

I hope I have been clear because it is not easy to explain everything, the project is quite complex …  
Thank you

---

<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: [June 12, 2020, 11:58pm UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/6 "2020-06-12T23:58:00Z")

</div>

Here’s how I envision the solution: you can use a QUERY for this.

Let’s say in your historic sheet, equipment ID is in column A, all the dates are stored in column B.

In your material sheet, for the last date column you want to have, add:

```
=ARRAYFORMULA(IF(A2:A<>"",VLOOKUP(A2:A,SORT(Historic!A2:B,2,FALSE),2,FALSE),""))

```

This works in the way that you have the sort function automatically sort the Historic sheet by the date column. The Vlookup’s behavior is that it only returns the first match, hence the latest one.

Please try it for your case and let me know if I can help.

---

<div class="post-metadata">

### Author: ![ced285](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ced285/32/9002_2.png) [@ced285](https://community.glideapps.com/u/ced285)
#### Post date: [June 13, 2020, 7:32am UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/7 "2020-06-13T07:32:33Z")

</div>

thank you very much for your help, it works perfectly … you saved me a considerable time.  
I added the function (IFERROR) if the ID is not yet in the history.  
[https://docs.google.com/spreadsheets/d/1H6x2CVUXb0a5ZEWRCgmjbGtDNBnBr5sGrV4iTLWikO8/edit?usp=sharing](https://docs.google.com/spreadsheets/d/1H6x2CVUXb0a5ZEWRCgmjbGtDNBnBr5sGrV4iTLWikO8/edit?usp=sharing)  
Last little suggestion … Each check is carried out by a person …  
From this formula, how to retrieve the entire content of the line (choose the elements or not to keep). In the case example, also recover the name of the inspector?

Thank you again for your help, making a verification and monitoring tool for security equipment with GLIDE would be great!

Ced

---

<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: [June 13, 2020, 8:09am UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/8 "2020-06-13T08:09:07Z")

</div>

You can add an element to the VLOOKUP like this:

`=ARRAYFORMULA(IF(A2:A<>"",VLOOKUP(A2:A,SORT(Historic!A2:C,2,FALSE),{2,3},FALSE),""))`

The {2,3} is an array and it tells the formula to return column 2 and 3, not just 2 like the previous one.

---

<div class="post-metadata">

### Author: ![ced285](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ced285/32/9002_2.png) [@ced285](https://community.glideapps.com/u/ced285)
#### Post date: [June 13, 2020, 9:21am UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/9 "2020-06-13T09:21:34Z")

</div>

It works, Thank you very much for your help and your responsiveness!

---

<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: [June 13, 2020, 9:22am UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/10 "2020-06-13T09:22:18Z")

</div>

If you have anything else to ask feel free to comment here, have a nice weekend 😄

---

<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: [June 13, 2020, 9:23am UTC](https://community.glideapps.com/t/data-calculate-in-data-editor-to-gsheets/10735/11 "2020-06-13T09:23:12Z")

</div>

If it helps you to manage your work, I have written 2 posts about ARRAYFORMULA and QUERY and will publish one more about QUERY in the coming days.

> [@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):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …

> [@Tutorial - QUERY: "The most powerful function" in Google Sheets (part 1)](https://community.glideapps.com/t/tutorial-query-the-most-powerful-function-in-google-sheets-part-1/10432):
>
> This topic was inspired by our last community meetup, in which we talked about some formulas in Google Sheets and some people want to know more about QUERY, which was branded [“The most powerful function in Google Sheets”](https://www.benlcollins.com/spreadsheets/google-sheets-query-sql/) by famous GSheets teacher Ben Collins. So, what is QUERY, and why is it so powerful. Here’s a writeup on it, which hopefully would help many of you here in this community. Trust me, it would change so much how many of you “clean” your data in the future from raw data, in a very…
