Google Sheets – Problem Combining LEFT() and QUERY() Functions

formulasgoogle sheetsgoogle-sheets-query

I'm currently working in Google Sheets and I need to import a part of a row from a spreadsheet to another. I'm importing the row with the QUERY() function and "cutting" the data from the row with LEFT() function. Something like this:

=LEFT(QUERY(IMPORTRANGE("1MkAat5Q791H0UKOuGwMIz2d8crocbNecyF4jnXo9K58";
 "Notas 1ºA No Pivoteadas!A1:D527");"select Col1");8)

The problem is that only applies the LEFT() function to the first cell of the row and the whole row taken from the query is filled with the same cell.

Any suggestions?

Best Answer

  • add continuosity with ARRAYFORMULA():

    =ARRAYFORMULA(LEFT(QUERY(IMPORTRANGE("1MkAat5Q791H0UKOuGwMIz2d8crocbNecyF4jnXo9K58"; 
     "Notas 1ºA No Pivoteadas!A1:D527"); "select Col1"); 8))

  • for number-text combo add TO_TEXT():

    =ARRAYFORMULA(LEFT(QUERY(TO_TEXT(IMPORTRANGE(
     "1MkAat5Q791H0UKOuGwMIz2d8crocbNecyF4jnXo9K58"; 
     "Notas 1ºA No Pivoteadas!A1:D527")); "select Col1"); 8))