Search code examples
google-sheetsgoogle-sheets-formula

How to return the latest entries of each PO items considering the timestamp and its various stages using Google Sheets?


A PO can go through stages and at each stage, it gets a timestamp. The expectation is to have a list of the PO at its latest stage and its related rows.

Here is a file for attempting to ace it with practical example. I've tried and got to this based on a previous question, but it doesn't give the correct result.

=MAP(UNIQUE(B1:B17);LAMBDA(id;XLOOKUP(id;B1:B17;A1:H17;;;-1)))


Solution

  • Added formula to your sheet here, Please do test it out.

    =let(Σ;sortn(sort(A2:H17;7;0;3;1);9^9;2;4;1);sort(filter(A2:H17;xmatch(byrow({G2:G17\F2:F17\C2:C17};lambda(z;join("";z)));byrow({index(Σ;;7)\index(Σ;;6)\index(Σ;;3)};lambda(z;join("";z)))));4;1))
    

    enter image description here