Forum Discussion

anupambit1797's avatar
anupambit1797
Iron Contributor
Feb 07, 2025
Solved

Missing slots calculation

Dear Experts,                      I have data like below:- Each Frame(Column A) has 4 corresponding slots(Column B) :- So, A6(955) has entry 3,8,13,18 , which is a complete set, and so on as ...
  • SergeiBaklan's avatar
    SergeiBaklan
    Feb 08, 2025

    I'd suggest to add helper column to group frames, something like

    =N($I1) + --([@Frame] <> $A1)

    Next we could GROUPBY by them

    =LET(
        slots, {3,8,13,18},
        frames, GROUPBY(
            HSTACK( Table1[[#All],[Group]],Table1[[#All],[Frame]] ),
            VSTACK("Missed", Table1[Slot] ),
            LAMBDA(a, ARRAYTOTEXT( TOROW( slots / ISNA( XMATCH( slots,a ) ),2 ) ) ),
            3  ),
        dropped, DROP(frames,,1),
        FILTER( dropped, NOT( ISERROR( CHOOSECOLS(dropped,2) ) ) )
    )

    Performance is not very good. Perhaps we may optimize above, but don't thing that dramatically.

    By the way, in Power Query version is the bug, very last frame is not calculated correctly. Since you prefer formula I didn't fix it.

Resources