简体   繁体   中英

Import data from a Google spreadsheet to another based on a cell value

I have 2 spreadsheets, I want to import data from one of them to another based on a cell value

Example: Sheet (A) has a column contains status (Review - Under processing -...etc). I want to import just the data in the row that contains (Review) status.

This should do the trick:

=QUERY(IMPORTRANGE("[URL FOR SHEET A]","[DATA RANGE]"),"WHERE colX CONTAINS '(Review)'",1)

Detail:

This: IMPORTRANGE("[URL FOR SHEET A]","[DATA RANGE]") will link the two spreadsheets together. Note that you will have to grant the second spreadsheet permission to read from the first one when you first enter the function. You can play around with the datarange and use open ranges in case the data set is likely to grow.

Then: QUERY([DATA],"[STATEMENT]",[HEADER]) will allow you to import only the stuff you want. Read up on the function to understand more, it is very useful. Only thing to note is that normally it will use the column letters (eg A, B, C) to refer to the columns, but since it's wrapped around the importrange and doesn't receive column letters, you have to use Col1, Col2, Col3 etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM