COUNTIFS Function for Multiple Criteria in Single & Multiple Column

petes

Board Regular
Joined
Sep 12, 2009
Messages
168
I have 2 columns in spreadsheet as mentioned below:

Column A Column B

Closed Master
Open Slave
Error Master
Hold Master
Reopen Slave

I need to Count all "Closed", "Open" & "Hold" status from Column A and corresponding "Master" status from Column B so that the output of that formula will be "2" as per the above example.

Thanks Guys!!!!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hey Gopala!! Thanks for the formula but i need some little alternations

Actually, this formula should count all "Master" from Column A and status NOT EQUAL to "Closed", "Open" & "Hold" from column B. I tried altering the formula but did'nt work

This what is what i changed which is not working and returning #NA error

Rich (BB code):
 =SUMPRODUCT(--(B1:B6="Master")*(A1:A6<>{"Closed","Open","Hold"}))

Thanks!!
 
Upvote 0
I have 2 columns in spreadsheet as mentioned below:

Column A Column B

Closed Master
Open Slave
Error Master
Hold Master
Reopen Slave

I need to Count all "Closed", "Open" & "Hold" status from Column A and corresponding "Master" status from Column B so that the output of that formula will be "2" as per the above example.

Thanks Guys!!!!

Try...

=SUM(COUNTIFS(A2:A6,{"Closed","Open,"Hold"},B2:B6,"Master")
 
Upvote 0
If u need other than the {"Closed","Open","Hold"} then try substracting from the whole sum

Try this:

Rich (BB code):
=counta(A1:A6)-SUMPRODUCT(--(B1:B6="Master")*(A1:A6<>{"Closed","Open","Hold"}))
 
Upvote 0
Hey Goapal!!

Output of this formula is retuning -2. But actually i am expecting 1
Because, after excluding "Closed","Open","Hold" status, i will be left with "Error" in Column A and "Master" in column B. Hence, it should display 1

Any thoughts..??
 
Upvote 0
Mis read the post

Try it

Code:
=SUMPRODUCT(--(B1:B6="Master")*(A1:A6<>"Open")*(A1:A6<>"Closed")*(A1:A6<>"Hold"))
 
Last edited:
Upvote 0
Hey Goapal!!

Output of this formula is retuning -2. But actually i am expecting 1
Because, after excluding "Closed","Open","Hold" status, i will be left with "Error" in Column A and "Master" in column B. Hence, it should display 1

Any thoughts..??

One of:

=SUM(COUNTIFS(A2:A6,{"Closed","Open,"Hold"},B2:B6,"Master")

=SUM(COUNTIFS(A2:A6,"<>"&{"Closed","Open,"Hold"},B2:B6,"Master")
 
Upvote 0
Thanks a lot Gopala!! this is exacatly what i was looking for...

@Aladin: your fucntion was also useful...

Thanks again guys!!
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top