Counting Two Columns based on Criteria

Excel_77

Active Member
Joined
Sep 15, 2016
Messages
306
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

I am working on spreadsheet 2.

I want to go into spreadsheet1 (tab1), search column A for "Yes" and column B for "George", if both criteria is met I want to return the number of entities, how is this done?

Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I think you need to clarify that a bit more.
Is it an AND or and OR situation?, i.e.
Count records where column A is NOT Yes AND column B is NOT No
-or-
Count records where column A is NOT Yes OR column B is NOT No

Also, do you want to count blank rows?
 
Upvote 0
I think you need to clarify that a bit more.
Is it an AND or and OR situation?, i.e.
Count records where column A is NOT Yes AND column B is NOT No
-or-
Count records where column A is NOT Yes OR column B is NOT No

Also, do you want to count blank rows?

Don't count blank rows.

So for example count the entities in column A that are not equal to "Yes" and the entities in Column B that are not equal to George.
 
Upvote 0
So, if I understand you correctly, here are some examples:
Code:
Column A    Column B    Result
Yes         George      Don't count
Yes         Bob         Don't count
No          George      Don't count
No          Bob         Count
Is that correct?
 
Upvote 0
So, if I understand you correctly, here are some examples:
Code:
Column A    Column B    Result
Yes         George      Don't count
Yes         Bob         Don't count
No          George      Don't count
No          Bob         Count
Is that correct?

That is correct, apologies for my poor explanation.
 
Upvote 0
Try:
Code:
=COUNTIFS(Sheet1!A:A,"<>" &"Yes",Sheet1!A:A,"<>" &"",Sheet1!B:B,"<>" & "George",Sheet1!B:B,"<>" & "")
This does not count any records with a blank in either column A or B.
 
Upvote 0
Joe4 can you please take me a doubt...
Do we really need the "<>"&"" to the empty criteria? I tried as bellow and it worked...

=COUNTIFS(Sheet1!A:A,"<>"&"Yes",Sheet1!B:B,"<>"&"George",Sheet1!A:A,"<>",Sheet1!B:B;"<>")

Thank you..
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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