Adding Another Condition to 'Countifs' Formula to not count duplicates

tvanpelt

New Member
Joined
Feb 20, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Good Morning Everyone,

within this formula I'm using,
Excel Formula:
=COUNTIFS($D$2:D$199969, D2, $C$2:C$199969, "<=" & C2, $C$2:$C$199969, ">=" & EDATE(C2, -6), $H$2:$H$199969, "Stands")

The formula tells me how many compliance events a specific person has at the workplace on a rolling six month basis. This formula returns that number of compliance events in Column J. Each Compliance Event has a specific ID attached to it. What I need it to do is also check Column F and if its a duplicate id, instead of counting it as another compliance event, I just need it to return the number of events that is listed as if it werent counting duplicates.

I've tried indexing and matching but i keep getting it to return 0. I tried utilizing a help column but it kind of feels like it defeats the purpose. Is there something that I may do to get the results I need? I have attached an image with the example. Thank you
 

Attachments

  • Excel.PNG
    Excel.PNG
    29.3 KB · Views: 22

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IFERROR(ROWS(UNIQUE(FILTER($F$2:F$199969,($D$2:D$199969=D2)*($C$2:C$199969<=C2)*($C$2:$C$199969>=EDATE(C2, -6))*($H$2:$H$199969="Stands")))),0)
 
Upvote 1
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=IFERROR(ROWS(UNIQUE(FILTER($F$2:F$199969,($D$2:D$199969=D2)*($C$2:C$199969<=C2)*($C$2:$C$199969>=EDATE(C2, -6))*($H$2:$H$199969="Stands")))),0)
Hi! Thank you so very much! That worked perfectly! I'm going to break the formula down to see what I was missing. Thank you :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

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