Countif Multiple Criteria Google Sheets

MilanB

New Member
Joined
Feb 9, 2021
Messages
21
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
  2. Web
Hello. I tried to make a formula for counting multiple criteria, but I need some assistance. I need to count how many contracts were made by an employee, exist different types of contracts marked with some code (120, 121, 122...). But if employees make many contracts of the same code and for the same company needs to be counted only as 1. For example, as you can see in the image, an employee with the name "ANA" made twice contract "120" for "COMPANY 1" but this needs to be counted as 1, not 2. Results need to be written in the table below.
 

Attachments

  • img.png
    img.png
    22.1 KB · Views: 21

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about
Excel Formula:
=ROWS(UNIQUE(FILTER($C$4:$C$11,($A$4:$A$11=$A18)*($B$4:$B$11=B$17))))
 
Upvote 0
Solution
Thanks. That formula works, only instead of 0, it shows #N/A.

I now see that I miss one important thing. Some of the contracts have different variants, for example, 120, 120a, 120b... they all need to be counted as 120.
 

Attachments

  • img2.png
    img2.png
    22.7 KB · Views: 17
Upvote 0
Are you doing this in Excel or some other software?
 
Upvote 0
In that case you should make that clear (preferably in the thread title) as Excel & Sheets are not the same.
Also questions regarding Sheets should be posted in the General Discussion & Other Applications section of the board.

I have done that for you this time.
 
Upvote 0
You could try
Excel Formula:
=IFERROR(ROWS(UNIQUE(FILTER($C$4:$C$11,($A$4:$A$11=$A18)*(LEFT($B$4:$B$11,LEN(B$17))=B$17&"")))),0)
but I don't know if that works in Sheets.
 
Upvote 0
Sorry, didn't know that I need to write in a different section of the forum.

This formula doesn't work, only gives the answer "TRUE".
 
Upvote 0
In that case unfortunately I cannot really help as it works in Excel & I don't know much about Sheets.
That said I don't see how the formula can return True.
 
Upvote 0

Forum statistics

Threads
1,223,355
Messages
6,171,615
Members
452,411
Latest member
sprichwort

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