Excel Create a column of Items Not on a list

Anonymous
2024-06-03T13:46:27+00:00

Sorry not good title,

Say I have a two column table names and items bought but I want another if Items not bought by each
person on the first 'sales' list, so on power query this could be

Table.Group( Source, "Name",

{{ "DidNotBuy", each

List.RemoveMatchingItems( ITtable [Items] , List.Distinct([Item]) ) }} )

so bringing in product table as list and subtracted items bought , this can then be expanded and pivoted.

in excel have got as far as this Items = All items, the right table has been sorted, but his is just for clarity,


any ideas?

Richard. s

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ashish Mathur 100.9K Reputation points Volunteer Moderator
    2024-06-03T23:41:54+00:00

    Hi,

    My not be a perfect solution but gets most of what you want

    =DROP(REDUCE("",TOCOL(DROP(REDUCE("",UNIQUE(C2:C14),LAMBDA(a,i,VSTACK(a,i&":"&TOROW(FILTER($A$2:$A$6,COUNTIFS($D$2:$D$14,$A$2:$A$6,$C$2:$C$14,i)=0,""))))),1),3),LAMBDA(a,i,VSTACK(a,TEXTSPLIT(i,":")))),1)

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. HansV 462.4K Reputation points MVP Volunteer Moderator
    2024-06-03T15:00:28+00:00

    Using just Excel formulas. ChangeTable1 to the name of the first table (the one with the Items column) and Table2 to the name of the second table (the one with the Name and Item columns).

    =LET(
      names, UNIQUE(Table2[Name]),
      num_names, COUNTA(names),
      items, Table1[Items],
      num_items, COUNTA(items),
      all_combos, MAKEARRAY(num_names*num_items, 2,
        LAMBDA(r,c,
          IF(c=1,
            INDEX(names, QUOTIENT(r-1, num_items)+1),
            INDEX(items, MOD(r-1, num_items)+1)
          )
        )
      ),
      FILTER(all_combos,
        COUNTIFS(Table2[Name],
          CHOOSECOLS(all_combos, 1), Table2[Item],
          CHOOSECOLS(all_combos, 2)
        )=0,
        ""
      )
    )
    

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-06-06T15:29:39+00:00

    Hi,

    I did say I'd get back, not quite the same as either of you,

    = DROP( REDUCE( "",H3:H5, LAMBDA(x,y, VSTACK(x,

    IFNA( HSTACK( y, FILTER( Table25[ItemL], ISNA( MATCH( Table25[ItemL], UNIQUE( FILTER( Table36[Item],Table36[Name] = y)),0)))),y)))),1)

    Richard.

    0 comments No comments