MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Arrays misbehaving


Posted by Raoul on February 15, 2002 6:51 AM

It looks like the following array (CSE!) - comparing two columns of numbers - is only looking at the first row in each case. Can anyone see what's wrong here?

=SUM(IF((G11:G23)=(G41:G53),(G11:G23),0))

Any help would be appreciated on this one

Thanks


Posted by Aladin Akyurek on February 15, 2002 6:54 AM

You're comparing ranges of unequal size.

=============

Posted by Mark W. on February 15, 2002 7:07 AM

G11:G23, G41:G53 are of equal size.

Posted by Mark W. on February 15, 2002 7:12 AM

There's nothing wrong with your formula...

It works just fine for me. If you are certain
that you've properly entered it as an array
formula (and I suspect you have because you'd get
a #VALUE! error otherwise) then examine the
values in G11:G23 and G41:G53 and make sure that
they are of the same data type -- numeric.

Posted by Raoul on February 15, 2002 8:19 AM

Re: There's nothing wrong with your formula...

Thanks for this, I think that it is just performing a different calculation to the one that I was looking for. I wanted to be informed (I expected to get a zero, but "Error" would be better) if the two columns were not equal otherwise return the total of one of them.

I appreciate your help here