Earlier on today some of you guys gave me some good tips on using SUMPRODUCT to perform criteria based array functions. previously i had used array formulas with SUM and IF statements, however these appear to be alot slow on the scales im using them for.
My question relates to using the SUMPRODUCT function with an OR criteria. lets say we want to sum column C based on a conditional statement including both col A and B, e.g. sum C1:10 where A1:A10="motor" OR B1:B10="continuous"
=sumproduct((A1:A10="motor")+(B1:B10="continuous"),(C1:C10))
now this formula would work perfect if both conditions were not encountered in the same row. In the event that it does happen though you encounter a double count. as both conditons will give a TRUE result and the addition places a 2 in the array - doh! So is there a function i can use to limit the value of (A1:A10="motor")+(B1:B10="continuous") to 1 so that this unwanted double count doesn't happen?
cheers
My question relates to using the SUMPRODUCT function with an OR criteria. lets say we want to sum column C based on a conditional statement including both col A and B, e.g. sum C1:10 where A1:A10="motor" OR B1:B10="continuous"
=sumproduct((A1:A10="motor")+(B1:B10="continuous"),(C1:C10))
now this formula would work perfect if both conditions were not encountered in the same row. In the event that it does happen though you encounter a double count. as both conditons will give a TRUE result and the addition places a 2 in the array - doh! So is there a function i can use to limit the value of (A1:A10="motor")+(B1:B10="continuous") to 1 so that this unwanted double count doesn't happen?
cheers