Countifs exclude based on other criteria

dekeda

New Member
Joined
Jul 8, 2016
Messages
2
I have a data set where I am using a "countifs" function to count entries based on ID and date range. I need to integrate another data set with a unique format, but some of the same columns, and then ONLY count unique entries based on ID, date range, and exclude entries based on a third criteria (appointment number) that also have the same ID and appointment number in the first set of data. I cannot just combine the two data sets and remove duplicates. Hope this makes sense.

I can't copy the file here as it is proprietary, but to simply and boil it down I basically have the following data set:

Capture_zpsrupd4lhv.png


The 2nd data set (I formatted it the same for simplicity) would be like this:

Capture2_zpsooknckl5.png


I need a formula that references a cell with the ID, and then counts the unique entries in the second data set where the Number column is not found in the first data set. So for "Aa0001" it would exclude the first two entries, and count everything highlighted yellow, and for "Bb0001" it would exclude the first two entries and count everything highlighted in blue.

Many thanks in advance for your help!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Welcome to the forum.

I'm a little confused, are you looking for a count of the unmatched items (the yellow and blue cells), or a list of the unmatched items?

ABCDEFGHI
1IDIDNumberIDUnmatched entries
2Aa00011Aa00011Bb00014
3Aa00012Aa00012
4Aa00013Aa000115
5Aa00014Aa000116
6Aa00015Aa000117
7Aa00016Aa000118
8Aa00017Aa000119
9Aa00018Aa000120
10Bb00019Bb00019
11Bb000110Bb000110
12Bb000111Bb000121
13Bb000112Bb000122
14Bb000113Bb000123
15Bb000114Bb000124
16

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet7

Worksheet Formulas
CellFormula
I2=SUMPRODUCT(--ISERROR(MATCH(E2:E15&"|"&F2:F15,A2:A15&"|"&B2:B15,0)),--(E2:E15=H2))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Here's a formula that finds the count. Let me know if this is what you're looking for.
 
Upvote 0
That's exactly what I need! Works beautifully. Thank you for the quick reply, you just saved me hours worth of research and work. Simple yet ingenious way of identifying the unique values and adding them up.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,450
Members
449,453
Latest member
jayeshw

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