Adding conditional data from 2 separate columns

  • Thread starter Thread starter Drew
  • Start date Start date
D

Drew

Hello!

Hope someone out there can help, Ive fallen and I cant get up!

Basically, I am trying to write a formula that reads something like
this:

If ('data' from 'worksheet a'! column E4:E695 is "X" AND 'data' from
'worksheet a'! column F4:F695 is "Y") then add them up in a certain
cell on a different worksheet.

So, If I have 10 instances in worksheet a column e is X and in column f
is Y, it should add up to 10.

I hope this makes sense. I tried using the COUNTIF function, but cant
seem to get it right.

FWIW, I didnt write the program, I am just trying to modify it.

Thank you,
Drew
 
One way

=SUMPRODUCT(--('worksheet a'!E4:E695="X"),--('worksheet a'!F4:F695="Y"))

will count the number of times both conditions are true

If you meant either E4:E695 = x or F4:F695 = y

=SUMPRODUCT(('worksheet a'!E4:E695="X")+('worksheet a'!F4:F695="Y"))
 
SUM in a cell and CF>Formula Is>=SumCell=Criteria
where SumCell is the cell where you summed and Criteria is...well, your
criteria. If the SumCell is on a different ws, it has to be named.
 
Back
Top