How to display registered values in a Google Drive spreadsheet in another via JS query

Asked

Viewed 2,714 times

2

I have a table in Google Drive and I want to use Scripts to do what I want to stay in a more dynamic way.

On Page2, I have the fields "Result" "Delay" and "Arrival" with their due results filled below, I want to create on Page1 in a field, a select that consult on Page2, in the Result, Delay and Arrival fields and show me the records registered on Page2, in the column next to where it selects the field (in case the results should come in column B1 and the term sought is in column A1 with the select’s section).

Página1 -consulta de resultados (quero o resultado na coluna B) Pagina 2 com os registrados que desejo mostrar cadastrados

1 answer

1

If you want to take the data from one sheet on another use this: (source)

// Pega o conteúdo da A1 na Sheet1:
=Sheet1!A1

// Caso a folha tenha espaços no nome use isso:
='Sheet number two'!B4

Continuing the answer, according to what the author wants:

In cell A1 use a data validation to create a field.
In cell B2 use the function lookup():

// Documentação:
=LOOKUP(celula com a caixa de selecao, celulas com o título, celulas com os dados)

// Utilização:
=LOOKUP($A$1, Sheet2!$A$1:$B$1, Sheet2!$A2:$B2)

Where Sheet2 is the name of the sheet where the data is. Then pull the B2 cell down filling the other cells that will show the data of the other sheet.

  • Friend, I enter this code where? I don’t know Excel, I’m trying to figure out how to do it, asked me and I think I can... Thanks from now on!!

  • I do not only want the data, I want it to be a select that has the RESULT/DELAY/ARRIVAL fields in field A1 and that the data recorded below RESULT/DELAY/ARRIVAL appear in field B1 next

  • Got it wrong. BTW Google Drive is quite different from Excel. I will edit my answer.

  • Dude, I tried several ways...what would it be like to save the list items? I couldn’t do no, I just got "#ERROR!" when I play the code "=LOOKUP($A$1, Page 2! $A$1:$B$1, Page 2! $A2:$B2)"

  • The version of Google Docs you are using in this function? It is the updated version (New Google Spreadsheets)?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.