2

I am importing multiple sheets into one using importrange and query function. Each sheet belongs to a different person. Is it possible to show which person the imported row belongs to?

I have:

=QUERY({importrange({"https://docs.google.com/spreadsheets/d/dsafdsf33/edit#gid=0"},"Original!A4:V");importrange("https://docs.google.com/spreadsheets/d/2sdfsad34543/edit#gid=0","Original!A4:V")},"SELECT Col2,Col5,Col4,Col7,Col9,Col12 Where Col8='AU'")

This is importing data from Bob and Steve. I would like to have the row (first column maybe) to say whether the row is being imported from Bob or Steve. Is this possible?

1
  • Are Bob and Steve two different Spreadsheets or are they two different sheets of the same spreadsheet? Most importantly, how would you want to show which person the imported row belongs to? Writing it in the cell next to the imported range? Thanks for the clarification. Also, if you could share a sample of your sheets that does not contain any sensitive information it could be really useful to clarify your question. Commented Mar 20, 2020 at 14:36

1 Answer 1

2

without scripts it could be only hardcoded like this:

=ARRAYFORMULA(QUERY({
 {IMPORTRANGE("abc", "Original!A4:V"), IMPORTRANGE("abc", "Original!Z4:Z")&"Bob"}; 
 {IMPORTRANGE("xyz", "Original!A4:V"), IMPORTRANGE("xyz", "Original!Z4:Z")&"Steve"}},
 "select Col2,Col5,Col4,Col7,Col9,Col12,Col19
  where Col8='AU'"))

where Z4:Z range is an empty column

Sign up to request clarification or add additional context in comments.

2 Comments

I changed Z4:Z to AB4:AB to match the first empty column. I am getting formula parse error.
@TarikHodzic fixed, try now

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.