Anyway to put logic into a single countif, sumif etc?

  • Thread starter Thread starter BlueWolverine
  • Start date Start date
B

BlueWolverine

Is there anyway to countif for multiple things?

like = countif(Range, "1" or "2")

I know you can do "<>1" dor does not equal but can you do combos within a
countif or do you have to run multiple countifs

Thanks
 
Hi there Blue,

Yes, there is. You can either use two COUNTIF() functions...

=COUNTIF(A2:A10,"=1")+COUNTIF(A2:A10,"=2")

Or you can use a slight workaround for using only one function...

=SUMPRODUCT((A2:A10=1)+(A2:A10=2))

Change the range(s) to suit. Note if you are using the SUMPRODUCT()
function the ranges must be exactly the same in dimensions. The COUNTIF()
should work faster though.

HTH
 
Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry
 
=COUNTIF(O23:Q23,O24)+COUNTIF(O23:Q23,P24)

--
Zack Barresse




Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry
 
Or..

=COUNT(IF((O23:Q23=O24)+(O23:Q23=P24),O23:Q23))

Confirmed with Ctrl + Shfit + Enter

--
Zack Barresse



Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry
 

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

Back
Top