ignore cells that are blank

R

Robert

Hello, I am using the following formula to count the number of occurrences of
my data being out of tolerance. My column of data (J46:J522) contains
numbers and blank cells. My upper and lower tolerances are contained in
cells L3 and L4. Therefore this equation is counting the number of data
results less than the lower tolerance and higher than the high tolerance.
This formula works great when L3 and L4 are bilateral (i.e. +/-.001). But a
problem arises when L3 and L4 are unilateral (i.e. +.001/+.002). This is
because the formula is treating blank cells as 0.

Is there a way to make this formula ignore the blank cells?

{=SUM(IF((J46:J522<L4)+(J46:J522>L3),1,0))}
 
T

T. Valko

Try this (normally entered):

=SUMPRODUCT(--(J46:J522<>""),--(J46:J522>L3),--(J46:J522<L4))
 
R

Robert

For some reason your equation returns a value of zero always, regardless of
what numbers I have in L3 and L4. Do you know why this might happen?
 
R

Robert

Interestingly, this one DOES work:

=SUMPRODUCT(--(J46:J522<>""),--(J46:J522<L4))+SUMPRODUCT(--(J46:J522<>""),--(J46:J522>L3))
 
T

T. Valko

Your array formula is written as an "or" conditional test.

J46:J522<L4 OR J46:J522>L3

The formula I suggested is written as an "and" conditional test:

J46:J522>L3 AND J46:J522<L4

The formula that you got to work is essentially the same as the "or" version
but it's spread across two separate functions.

This one will do the same thing:

=SUMPRODUCT(--(J46:J522<>""),--((J46:J522<L4)+(J46:J522>L3)>0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top