Searching many sheets for values and put the results in one sheet

Viewed 38
2 Answers

I duplicated your DB tab and entered the following in A2:

={unique({'1'!A2:A;'2'!A2:A;'3'!A2:A}),index(trim(split(transpose(query(if((index(split(flatten(query({'1'!A2:A;'2'!A2:A;'3'!A2:A}&"❄️"&{'1'!B2:C;'2'!B2:C;'3'!B2:C},"where not Col1 matches '^❄️$'")),"❄️"),,1)<>transpose(unique({'1'!A2:A;'2'!A2:A;'3'!A2:A})))+(index(split(flatten(query({'1'!A2:A;'2'!A2:A;'3'!A2:A}&"❄️"&{'1'!B2:C;'2'!B2:C;'3'!B2:C},"where not Col1 matches '^❄️$'")),"❄️"),,2)=""),,text(index(split(flatten(query({'1'!A2:A;'2'!A2:A;'3'!A2:A}&"❄️"&{'1'!B2:C;'2'!B2:C;'3'!B2:C},"where not Col1 matches '^❄️$'")),"❄️"),,2),"m/d/yyyy")),,9^9))," ")))}

Your dates format are inconsistent though. Some are d/m/yyyy others are m/d/yyyy so you should fix that.

either use:

=INDEX(TRIM(SPLIT(FLATTEN(QUERY(QUERY(TEXT(IFERROR(SPLIT(FLATTEN(SUBSTITUTE(
 {'1'!A2:A;'2'!A2:A;'3'!A2:A}, " ", CHAR(13))&"×"&{'1'!B2:F;'2'!B2:F;'3'!B2:F}), "×")), {"@", "dd/mm/yyyy"}), 
 "select max(Col2) where Col2 <> '30/12/1899' group by Col2 pivot Col1"),,9^9)), " ")))

enter image description here


or in B2:

=INDEX(IFERROR(VLOOKUP(A2:A, TRIM(SPLIT(FLATTEN(QUERY(QUERY(TEXT(IFERROR(SPLIT(FLATTEN(SUBSTITUTE(
 {'1'!A2:A;'2'!A2:A;'3'!A2:A}, " ", CHAR(13))&"×"&{'1'!B2:F;'2'!B2:F;'3'!B2:F}), "×")), {"@", "dd/mm/yyyy"}), 
 "select max(Col2) where Col2 <> '30/12/1899' group bY Col2 pivot Col1"),,9^9)), " ")), {2,3,4,5,6}, )))

enter image description here

Related