How can we perform common set operations (union, intersection, minus) in MS Excel?

前端 未结 4 1897
梦毁少年i
梦毁少年i 2021-01-05 15:00

For example, I have an xls where :

  • column A has list of items with property A
  • column B has list of items with property B

I need the fol

4条回答
  •  死守一世寂寞
    2021-01-05 15:32

    Intersection (In A & B): =IFNA(VLOOKUP(B2,$A$2:$B$42,1,FALSE),"")

    Union (In A or B): =IFS(A2,A2,B2,B2) Note that IFS is only in recent (as of 2018) versions.

    A - B (Only in A): =IF(NOT(IFNA(MATCH(A2,$B$2:$B$42,0),FALSE)),IF(A2,A2,""),"")

    B - A (Only in B): =IF(NOT(IFNA(MATCH(B2,$A$2:$A$42,0),FALSE)),IF(B2,B2,""),"") (Swap the letters)

提交回复
热议问题