If & Count Statement
Assuming you want to count *every* instance of 5 when 1 appears on the same
row:
=SUMPRODUCT((MMULT(--(A1:D4=1),{1;1;1;1})0)*(E1:H4=5))
Note: this is limited to a range size that is no more than 5461 rows.
A1:H5461 will work. A1:H5462 will not.
--
Biff
Microsoft Excel MVP
"Chris" wrote in message
...
I cannot seem to find an answer, so I am posting he
A B C D E F G H
1 1 5 3 4 2
2 1 4 4 3 5
3 2 3 4 4 3
4 2 3 3 3 5
What I am looking to do is create a formula that can look in columns A
through D for the numer 1. Then in those rows that have the number 1, to
count the numbers in that same row where there is a 5. So in the example
above, there are two rows with the number 1 - and if you count the cells
in
those two rows that have the number 5, it would equal 2.
I was trying to create this as one formula. Any help is appreciated.
Thanks
|