Google-sheets – Populate Last Cell With Query Function in Google Sheet

googlegoogle sheetsgoogle-sheets-query

Looking for a way to populate an additional column in possibly a QUERY function. The extra column will only have as many rows as the first set of data. Example being my data is Sheet1!A:A

enter image description here

and then on Sheet2 using something like =(query(A:A, "Select A"),[extra colB magic for 'TRUE']) I'd like the output to be

enter image description here

I am aware that it only takes 15 seconds to populate ColB to TRUE, but I'm looking to avoid the manual touch of doing this.

Thanks in advance

Best Answer

What you need to get the desired results would be:

=QUERY({'Sheet1!'!A1:A,ArrayFormula(IF(LEN('Sheet1!'!A1:A)<>0,REGEXREPLACE(TO_TEXT('Sheet1!'!A1:A),TO_TEXT('Sheet1!'!A1:A),"TRUE"),""))})

Functions used: