Forum Discussion
Joseph Assaf
Jun 18, 2018Copper Contributor
Comparing two ranges of cells in an if function
I have two rows of address information that I have to compare. If cells A-R in row 2 are identical to cells A-R in row three then I want cell S inn row three two be returned if true and blank if fal...
SergeiBaklan
Jun 19, 2018Diamond Contributor
It could be
=IF(SUMPRODUCT(--($A$2:$R$2<>$A$3:$R$3)),"",S3)
Joseph Assaf
Jun 23, 2018Copper Contributor
I tried this one, because it looks much easier than above but it always returns the true value even when I check it and I know its not. It looks like it should work. (Unless sumproduct function counts everything as a number value and doesnt work well with text- I dont know enough about it)
Thank you though. I do appreciate the help
- SergeiBaklanJun 24, 2018Diamond Contributor
Hi Joseph,
Yes, SUM ignores text and logical values, as well as SUMPRODUCT when it sums multiplication of the arrays.
In our case we have no one text value returning to SUMPRODUCT, we have only logical values TRUE or FALSE as result of cells comparasion. Logical values also don't work, thus with double dash we convert TRUE and FALSE in 1 and 0 accordingly (same result if we multiply resulting array on 1).
Finally SUMPRODUCT receives only numeric 1/0 array.
Back to your sample - in attached the formula works correctly.