I have used the following formula I scavenged off the net to merge multiple worksheets (in the same workbook) into one big master sheet, in Google Sheets.

 

=QUERY({(Sheet1!A4:O);(Sheet2!A4:O);(Sheet3!A4:O);(Sheet4!A4:O)},"Select * where Col1 is not null order by Col4",1)

 

This has worked for the most part.

 

Column1 holds a unique value for each row across all worksheets.

 

Column4 is a list of surnames, so its all sorted alphabetically which is nice.

 

But I dont know the purpose of the last "1" in the formula.

 

What does it do? And what effect would other values have?