0

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

6
  • Sorry. You totally lost me. If you want to populate an additional column then your second image should include column C with "TRUE" meaning A, B, C. To overwrite column B (as shown in your second image) is completely different. You also ask to "Populate Last Cell " when you later ask for an additional column. Please edit your question or read how to and share a test sheet so as you can be easier helped. Feb 26, 2020 at 5:52
  • @marikamitsos no you're spot on. I have one sheet with one column of data (ColA). I want to query it and then only populate the last column (ColB in this case) with "TRUE" but only as cells as ColA returns, so row count is equal. I'll update my question too.
    – Grant
    Feb 26, 2020 at 16:12
  • "you're spot on". but still lost. :) I gave you option 1 OR 2 and your answer was yes. Please rephrase. Do you want option 1 OR option 2. "Yes" is not an option. Feb 26, 2020 at 16:16
  • @marikamitsos, sorry for the confusion, was updating the main question when you replied. Looking for a way to just add an additional column with a preset value.
    – Grant
    Feb 26, 2020 at 16:23
  • 1
    So... You want column column A + a new column B where B shows TRUE whatever the value of A may be. Yes or No?. If no, what? Feb 26, 2020 at 17:12

1 Answer 1

1

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:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.