View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default if a1=b1=c1=d1....

On Fri, 8 Dec 2006 13:00:02 -0800, Jshendel
wrote:

is it possible to have this type of equation?
=if(a1=b1=c1=d1,"true","false")
I don't want to just find the sum of these cells because there may be other
instances where they do equal a sum, but are not equal to each other.
1 1 1 1 (right)
4 0 0 0 (wrong)


The array formula:

=SUM(1/COUNTIF(rng,rng))=1

(entered with <ctrl<shift<enter)

will return TRUE if they are all equal, FALSE if they are not, and result in a
DIV/0 error if there are blank cells.

You can test for the DIV/0 error if that is a problem.

rng can be any one dimensional range of cells that does not include an entire
column.
--ron