=sort(filter($A:$D,match($A:$A,query($A:$D,"Select max(A) GROUP BY B ORDER BY max(A) desc LABEL max(A) ''" ),0),match($B:$B,query(query($A:$D,"Select B, max(A) GROUP BY B ORDER BY max(A) desc LABEL max(A) ''" ),"Select Col1"),0)),1,FALSE)
I guess there is some fiddling around been done on the cells for data type. I created a new sheet and used ur formula. It is working. So I am creating a NEW sheet for office use. I am sure it will be good to go !
On my test file, the range of cells is showing in orange and other colours. On the office file it is showing in BLACK. if I change COMMA to SEMI COLON, then it changes to orange and other colours and identifies the cells on the sheet. But still returns error !
Looks like a locale issue as you say, the cell references are not taking. Either change the locale of the sheet to "en" or edit all the commas to semi-colons....
=sort(filter(Sheet2!$A:$D;match(Sheet2!$A:$A;query(Sheet2!$A:$D;"Select max(A) GROUP BY B ORDER BY max(A) desc LABEL max(A) ''" );0);match(Sheet2!$B:$B;query(query(Sheet2!$A:$D;"Select B, max(A) GROUP BY B ORDER BY max(A) desc LABEL max(A) ''" );"Select Col1");0));1;FALSE)