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-03T18:40:17+00:00

    Hi,
    have not had a chance to go through this yet, did have a couple of thought , using

    'items on list' as delimiters in text split, also using

    Hstack to stack name and item then each Vstacked on top of each other,
    I had a go manually, and thought of putting inside REDUCE , but my head started hurting.

    Thanks for the time you have taken over this, will get back to you, but my be a little while.

    Richard.

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2024-06-04T19:13:11+00:00

    Thanks,
    I've not had a chance to work through either, being trying other things,
    also dull but have to be done things,

    Will get around to it, and as always thank you for your help,

    Richard.

    0 comments No comments