Negate counts in COUNTIFS?

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
I was wondering if you can negate counts in a COUNTIFS?
Example:

=COUNTIFS(A:A,A2,B:B,B2,C:C,C2)
My formula is looking in all of column A (or Agent) with "John" as the Criteria.
My formula is looking in all of column B (or Day) with "Monday" as the Criteria.
My formula is looking in all of column C (or Time) with "18:00" as the Criteria

Outcome:
My formula works, it finds 3 instances of John, Monday and 18:00. However, what I would like is for the COUNTIFS to search an entire column like I have but if there are duplicates to some how have an end calculation of 1.


I would like this outcome with a result of 3:
=COUNTIFS(A:A,A2,B:B,B2,C:C,C2)
AgentDayTimeFormula
JohnMonday18:003
JohnMonday18:00
JohnMonday18:00

<tbody>
</tbody>


To look like this with a result of 1, with a COUNTIFS function if possible:
=COUNTIFS(A:A,A2,B:B,B2,C:C,C2)???
AgentDayTimeFormula
JohnMonday18:001
JohnMonday18:00
JohnMonday18:00

<tbody>
</tbody>
 
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(A2:A4&B2:B4&C2:C4<>"",MATCH(A2:A4&B2:B4&C2:C4,A2:A4&B2:B4&C2:C4,0)),ROW($A$2:$C$4)-ROW(INDEX($A$2:$C$4,1,1))+1),1))<strike></strike>
 
Last edited:
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This works, thank you. Your formula puts a 1 if the count is greater than 0 and the 1 entry date you had "John/Tuesday/1900" is left as a 1.
=IF(COUNTIFS($B:$B,B4,$C:$C,C4,$D:$D,D4)>0,1,0)

A B C D
1 Name Day TimeFormula
2 John Monday 18:001
3 John Monday 18:001
4 John Monday 18:001
5 John Monday 19:001
6 John Monday 19:001
7 John Tuesday 18:001
8 John Tuesday 18:001
9 John Tuesday 19:001

<tbody>
</tbody>

No need of any formula in column D since COUNTIFS always return a result greater than 0 (???)

M.
 
Upvote 0
Put a one at each unique item blank for dups?

=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2,C$2:$C2,C2)=1,1,"")

copied down

Could filter on ones then
 
Last edited:
Upvote 0
Put a one at each unique item blank for dups?

=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2,C$2:$C2,C2)=1,1,"")

copied down

Could filter on ones then

Of course I can get the same results with a simple Pivot Table and a unique count if needed
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

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