View Single Post
  #1  
Old April 23rd, 2004, 11:54 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default array formula to check if ranges are identical

"upstate_steve " wrote...
Is there an array formula that will determine if the data in two
multi-column ranges are identical?


Identical just in terms of contents, e.g., {1;2;3} would be identical to
{3;1;2}, or indentical in terms of both contents and location? If the latter,
there's always the array formula

=AND(RngA=RngB)

If the former, the array formula

=AND((COUNTIF(RngA,""&RngA)=COUNTIF(RngB,""&RngA ))
*(COUNTIF(RngA,""&RngB)=COUNTIF(RngB,""&RngB))
*COUNTIF(RngA,RngB)*COUNTIF(RngB,RngA))

Also, how would I return an array of the row numbers of the rows in
Range A that are not identical to the corresponding row in Range B?


=SMALL(IF(RngARngB,ROW(RngA)),ROW(INDIRECT("1:"& SUMPRODUCT(--(RngARngB)))))

I'm interested in a single array formula that will accomplish this, not
adding columns of formulas next to one of the ranges.


Such single array formulas would have variable sizes depending on what your
ranges exactly contain. You'd need to wrap them inside IF constructs or live
with error values in some cells.

--
To top-post is human, to bottom-post and snip is sublime.