Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
=QUERY({{sheet#1-range,index(substitute(sheet#1-range,sheet#1-range,"sheet1"))};{sheet#2-range,index(substitute(sheet#2-range,sheet#2-range,"sheet2"))};...,"Select * where Col1 is not null")
Try something like:
=QUERY({{sheet#1-range,"sheet1"};{sheet#2-range,"sheet2"};...,"Select * where Col1 is not null")
Try something like:
=QUERY({{sheet#1-range,index(substitute(sheet#1-range,sheet#1-range,"sheet1"))};{sheet#2-range,index(substitute(sheet#2-range,sheet#2-range,"sheet2"))};...,"Select * where Col1 is not null")