COUNTIFS Exclude Duplicates With Multiple Criteria

RYANE

New Member
Joined
Nov 3, 2015
Messages
11
Hello,

So I have a bit of a problem I am trying to solve and hope someone can share some of their wisdom.

I have a worksheet named "Commercial Bids" that contains a bunch of information my company uses for tracking work that looks like this:

Code:
[B]Excel 2007[/B][TABLE]
<tbody>[TR="bgcolor: #E0E0F0"]
[TH][/TH]
[TH]A
QUOTE DATE[/TH]
[TH]B
PROJECT NAME[/TH]
[TH]C
SITE ADDRESS[/TH]
[TH]D
CITY[/TH]
[TH]E
VOLUME[/TH]
[TH]F
BIDDER[/TH]
[TH]G[/TH]
[TH]H[/TH]
[TH]I[/TH]
[TH]J[/TH]
[TH]K[/TH]
[TH]L[/TH]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Jan 06, 16[/TD]
[TD="align: center"]Riverside Tenant Improvement[/TD]
[TD="align: center"]12200 Riverside[/TD]
[TD="align: center"]Richmond[/TD]
[TD="align: center"]20 m3[/TD]
[TD="align: center"]STEVE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]NO ACTION - 3/1 - GS[/TD]
[TD="align: center"]RMC[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Jan 07, 16[/TD]
[TD="align: center"]Newton Recreation Centre - Civil Works[/TD]
[TD="align: center"]13730 72 Avenue[/TD]
[TD="align: center"]Surrey[/TD]
[TD="align: center"]105 m3[/TD]
[TD="align: center"]GORDON[/TD]
[TD="align: center"][/TD]
[TD="align: center"]125.00[/TD]
[TD="align: center"]GS[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Jan 08, 16[/TD]
[TD="align: center"]Twassassen Commons Sidewalks[/TD]
[TD="align: center"]Hwy 17 & 52 St[/TD]
[TD="align: center"]Delta[/TD]
[TD="align: center"]250 m3[/TD]
[TD="align: center"]REX[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]GS[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]Jan 11, 16[/TD]
[TD="align: center"]Newton Recreation Centre[/TD]
[TD="align: center"]13730 72 Avenue[/TD]
[TD="align: center"]Surrey[/TD]
[TD="align: center"]200 m3[/TD]
[TD="align: center"]MARTIN[/TD]
[TD="align: center"][/TD]
[TD="align: center"]125.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Extended to 2016[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Jan 13, 16[/TD]
[TD="align: center"]REACH - Community Health Centre[/TD]
[TD="align: center"]1145 COMMERCIAL DRIVE[/TD]
[TD="align: center"]Vancouver[/TD]
[TD="align: center"][/TD]
[TD="align: center"]CARL[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Due: Jan 12, 2016[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]Jan 13, 16[/TD]
[TD="align: center"]REACH - Community Health Centre[/TD]
[TD="align: center"]1145 COMMERCIAL DRIVE[/TD]
[TD="align: center"]Vancouver[/TD]
[TD="align: center"]310 m3[/TD]
[TD="align: center"]STEVE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Due: Jan 15, 2016[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]Jan 13, 16[/TD]
[TD="align: center"]REACH - Community Health Centre[/TD]
[TD="align: center"]1145 COMMERCIAL DRIVE[/TD]
[TD="align: center"]Vancouver[/TD]
[TD="align: center"]500 m3[/TD]
[TD="align: center"]GORDON[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Due: Jan 12, 2016[/TD]
[TD="align: center"]RMC[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]Jan 13, 16[/TD]
[TD="align: center"]REACH - Community Health Centre[/TD]
[TD="align: center"]1145 COMMERCIAL DRIVE[/TD]
[TD="align: center"]Vancouver[/TD]
[TD="align: center"][/TD]
[TD="align: center"]MIKE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Due: Jan 12, 2016[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]Jan 13, 16[/TD]
[TD="align: center"]REACH - Community Health Centre[/TD]
[TD="align: center"]1145 COMMERCIAL DRIVE[/TD]
[TD="align: center"]Vancouver[/TD]
[TD="align: center"][/TD]
[TD="align: center"]SEAN[/TD]
[TD="align: center"][/TD]
[TD="align: center"]135.00[/TD]
[TD="align: center"]GS[/TD]
[TD]Due: Jan 19, 2016[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

I have a second worksheet named "Market Share" that uses COUNTIFS to track market share. The sheet looks like this:

Code:
[B]Excel 2007[/B][TABLE]
<tbody>[TR="bgcolor: #E0E0F0"]
[TH][/TH]
[TH]A[/TH]
[TH]B[/TH]
[TH]C[/TH]
[TH]D[/TH]
[TH]E[/TH]
[TH]F[/TH]
[TH]G[/TH]
[TH]H[/TH]
[TH]I[/TH]
[TH]J[/TH]
[TH]K[/TH]
[TH]L[/TH]
[TH]M[/TH]
[TH]N[/TH]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="bgcolor: #00B050, align: center"]2016 COMMERCIAL MARKET SHARE[/TD]
[TD="bgcolor: #404040, align: center"]JAN[/TD]
[TD="bgcolor: #404040, align: center"]FEB[/TD]
[TD="bgcolor: #404040, align: center"]MAR[/TD]
[TD="bgcolor: #404040, align: center"]APR[/TD]
[TD="bgcolor: #404040, align: center"]MAY[/TD]
[TD="bgcolor: #404040, align: center"]JUN[/TD]
[TD="bgcolor: #404040, align: center"]JUL[/TD]
[TD="bgcolor: #404040, align: center"]AUG[/TD]
[TD="bgcolor: #404040, align: center"]SEP[/TD]
[TD="bgcolor: #404040, align: center"]OCT[/TD]
[TD="bgcolor: #404040, align: center"]NOV[/TD]
[TD="bgcolor: #404040, align: center"]DEC[/TD]
[TD="bgcolor: #FF0000, align: center"]YTD[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="bgcolor: #D8D8D8, align: right"]VANCOUVER[/TD]
[TD="bgcolor: #D8D8D8, align: center"]10[/TD]
[TD="bgcolor: #D8D8D8, align: center"]4[/TD]
[TD="bgcolor: #D8D8D8, align: center"]4[/TD]
[TD="bgcolor: #D8D8D8, align: center"]4[/TD]
[TD="bgcolor: #D8D8D8, align: center"]5[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #D8D8D8, align: center"]0[/TD]
[TD="bgcolor: #FF0000, align: center"]27[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: right"]RMC AWARDED[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="bgcolor: #FF0000, align: center"]2[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="bgcolor: #FFFF66, align: right"]MARKET PERCENTAGE[/TD]
[TD="bgcolor: #FFFF66, align: center"]10%[/TD]
[TD="bgcolor: #FFFF66, align: center"]0%[/TD]
[TD="bgcolor: #FFFF66, align: center"]0%[/TD]
[TD="bgcolor: #FFFF66, align: center"]25%[/TD]
[TD="bgcolor: #FFFF66, align: center"]0%[/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"][/TD]
[TD="bgcolor: #FFFF66, align: center"]7%[/TD]
[/TR]
</tbody>[/TABLE]

The Market Share sheet uses the following code in the Vancouver row (B2 to be exact) to gather it's information:

Code:
=COUNTIFS('Commercial Bids'!$D$2:$D$9259,"Vancouver",'Commercial Bids'!$A$2:$A$9259,">=1/1/2016",'Commercial Bids'!$A$2:$A$9259,"<=1/31/2016")

Then it uses the next line of code to gather jobs we were awarded:

Code:
=COUNTIFS('Commercial Bids'!$D$2:$D$9259,"Vancouver",'Commercial Bids'!$A$2:$A$9259,">=1/1/2016",'Commercial Bids'!$A$2:$A$9259,"<=1/31/2016",'Commercial Bids'!K2:K9259,"RMC")


As you can see in the "Commercial Projects" worksheet there are multiple bidders under the same project. My current COUNTIFS code does not take that into account when making it's calculations, so the market share will be off.

Is there a way to have Excel ignore duplicate entries when using this code:

Code:
=COUNTIFS('Commercial Bids'!$D$2:$D$9259,"Vancouver",'Commercial Bids'!$A$2:$A$9259,">=1/1/2016",'Commercial Bids'!$A$2:$A$9259,"<=1/31/2016")

Any help would be appreciated!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,223,723
Messages
6,174,121
Members
452,545
Latest member
boybenqn

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