Forum Discussion
Does the union operator exist?
- Jul 27, 2021
Yes, the union operator does exist. The SUM function is not a very good example, since its syntax is
=SUM(range1, range2, range3, ...)
so comma acts as argument separator. Using double parentheses does force Excel to treat the comma as union separator, but the effect is exactly the same as using single parentheses.
Here is an example where comma is really used as union operator:
=LARGE((A1:C3,D4:E5),2)
The LARGE function has only 2 arguments: =LARGE(array, k). If you try
=LARGE(A1:C3,D4:E5,2)
you'll get an error since you specified too many arguments. In (A1:C3,D4:E5), the comma creates the union of A1:C3 and D4:E5.
But keep in mind that , is not a REAL union operator: if the ranges intersect, the intersection will be counted twice.
Let's say A1=1 and A2=2.
Both =SUM(A1:A2,A1:A2) and =SUM((A1:A2,A1:A2)) will return 6. If (A1:A2,A1:A2) was a real union, you'd expect the second formula to return 3, not 6.
Yes, the union operator does exist. The SUM function is not a very good example, since its syntax is
=SUM(range1, range2, range3, ...)
so comma acts as argument separator. Using double parentheses does force Excel to treat the comma as union separator, but the effect is exactly the same as using single parentheses.
Here is an example where comma is really used as union operator:
=LARGE((A1:C3,D4:E5),2)
The LARGE function has only 2 arguments: =LARGE(array, k). If you try
=LARGE(A1:C3,D4:E5,2)
you'll get an error since you specified too many arguments. In (A1:C3,D4:E5), the comma creates the union of A1:C3 and D4:E5.
But keep in mind that , is not a REAL union operator: if the ranges intersect, the intersection will be counted twice.
Let's say A1=1 and A2=2.
Both =SUM(A1:A2,A1:A2) and =SUM((A1:A2,A1:A2)) will return 6. If (A1:A2,A1:A2) was a real union, you'd expect the second formula to return 3, not 6.