Search code examples
google-sheetsconcatenationgoogle-sheets-formulagoogle-sheets-querytextjoin

How to import data that has a value from other sheets


I have 2 spreadsheets and I'm trying to get all the items that the QTY is not equal to zero.

Can someone help me, please?

Example. If the items in Spreadsheet 1 is not 0 it will transfer to Spreadsheet 2 in one cell.

Spreadsheet 1

*---*----*---*----*
|   | ITEMS  | QTY|
*---*--------*----*
| 1 | BOOK    | 4 |
| 2 | PEN     | 4 |
| 3 | tape    | 0 |
*---*----*--------*

Spreadsheet 2

+---+---------+
|   |   A     |
+---+---------+
| 1 | BOOK 4  |
|   | PEN  4  |
+---+---------+

This formula is the formula.

=JOIN(CHAR(10),QUERY(TRANSPOSE(IMPORTRANGE("URL","SUMMARY!B1:C3")),,2000000))

Solution

  • =TEXTJOIN(CHAR(10), 1, TRANSPOSE(QUERY(TRANSPOSE(QUERY(IMPORTRANGE(
     "ID", "Sheet1!A:B"), 
     "where not Col2 = 0 and Col1 is not null", 0)), , 999^99)))
    

    0