Find all that have only one type of value

Patty3-4

New Member
Joined
Feb 5, 2013
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Good morning, I'm trying to write a countifs formula that will identify all IDNUM2 (I.D. numbers) that have a specific value, if another column has a specific value.

In the attached spreadsheet there are several IDNUM2's (columnB). I want to identify those that have ONLY watermelons (FRUIT columnC) in wood (TYPE columnD). In the example there is only 2 that meet the criteria. IDNUM2's could have numerous rows.

So far I get a circular reference warning. Any help would be greatly appreciated.
IDNUM1IDNUM2FRUITTYPE
592​
1KWATERMELONCARDBOARD
234​
5SGUAVAWOOD
234​
5SPEACHESCARDBOARD
234​
5SAPPLESCARDBOARD
345​
6APEACHESCARDBOARD
587​
3BWATERMELONWOOD
587​
3BWATERMELONWOOD
245​
9FHONEYDEWWOOD
245​
9FJACKFRUITCARDBOARD
789​
7CWATERMELONWOOD
789​
7CWATERMELONCARDBOARD
801​
9EBLUEBERRIESCARDBOARD
801​
9EWATERMELONWOOD
402​
5AWATERMELONWOOD
604​
4PWATERMELONWOOD
604​
4PJACKFRUITCARDBOARD
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
why only 2 meet criteria
is that 3B because they also match ?
Book4
ABCD
25921KWATERMELONCARDBOARD
32345SGUAVAWOOD
42345SPEACHESCARDBOARD
52345SAPPLESCARDBOARD
63456APEACHESCARDBOARD
75873BWATERMELONWOOD
85873BWATERMELONWOOD
92459FHONEYDEWWOOD
102459FJACKFRUITCARDBOARD
117897CWATERMELONWOOD
127897CWATERMELONCARDBOARD
138019EBLUEBERRIESCARDBOARD
148019EWATERMELONWOOD
154025AWATERMELONWOOD
166044PWATERMELONWOOD
176044PJACKFRUITCARDBOARD
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D17Expression=COUNTIFS($B$2:$B$17, $B2, $C$2:$C$17, "watermelon",$D$2:$D$17,"wood")>1textNO
 
Upvote 0
Yes, only 3B and 5A meet the criteria.

I'm looking to flag (maybe with a "1") all IDNUM2's that ONLY have watermelon and wood so I can pull them into a pivot table. Others may have watermelon and wood but if they have anything else, they're disqualified.
 
Upvote 0
Not sure i understand why its only 3b and 5a ?
not 9e or 4p

you could add an IF into a new column , once the formula is as required
=IF ( COUNTIFS($B$2:$B$17, $B2, $C$2:$C$17, "watermelon",$D$2:$D$17,"wood")>1, 1,0)

 
Upvote 0
I can do it easily if there's only one row for a IDNUM2 with an IF AND formula, but not when they have multiple rows of data.
if(AND(B15<>B14,B15<>B16,C15="WATERMELON",D15="WOOD"),1,"")
 
Upvote 0
My take on this
+Fluff 1.xlsm
ABCD
1IDNUM1IDNUM2FRUITTYPE
25921KWATERMELONCARDBOARD
32345SGUAVAWOOD
42345SPEACHESCARDBOARD
52345SAPPLESCARDBOARD
63456APEACHESCARDBOARD
75873BWATERMELONWOOD
85873BWATERMELONWOOD
92459FHONEYDEWWOOD
102459FJACKFRUITCARDBOARD
117897CWATERMELONWOOD
127897CWATERMELONCARDBOARD
138019EBLUEBERRIESCARDBOARD
148019EWATERMELONWOOD
154025AWATERMELONWOOD
166044PWATERMELONWOOD
176044PJACKFRUITCARDBOARD
18
19
Primary
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D100Expression=SUMPRODUCT(($B$2:$B$100=$B2)*(($C$2:$C$100<>"Watermelon")+($D$2:$D$100<>"Wood")))=0textNO
 
Upvote 0
Solution
Not sure i understand why its only 3b and 5a ?
not 9e or 4p

you could add an IF into a new column , once the formula is as required
=IF ( COUNTIFS($B$2:$B$17, $B2, $C$2:$C$17, "watermelon",$D$2:$D$17,"wood")>1, 1,0)

9E also has blueberries and 4P has jackfruit. I tried the formula with one that should come back as 1 and it came back as 0.
 
Upvote 0
Oh , i think i see now that Fluff has posted and your explanation, i see
Fluff has a solution , for conditional formatting , which could be added to an IF to have a column with a 1 in
 
Upvote 0
My take on this
+Fluff 1.xlsm
ABCD
1IDNUM1IDNUM2FRUITTYPE
25921KWATERMELONCARDBOARD
32345SGUAVAWOOD
42345SPEACHESCARDBOARD
52345SAPPLESCARDBOARD
63456APEACHESCARDBOARD
75873BWATERMELONWOOD
85873BWATERMELONWOOD
92459FHONEYDEWWOOD
102459FJACKFRUITCARDBOARD
117897CWATERMELONWOOD
127897CWATERMELONCARDBOARD
138019EBLUEBERRIESCARDBOARD
148019EWATERMELONWOOD
154025AWATERMELONWOOD
166044PWATERMELONWOOD
176044PJACKFRUITCARDBOARD
18
19
Primary
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D100Expression=SUMPRODUCT(($B$2:$B$100=$B2)*(($C$2:$C$100<>"Watermelon")+($D$2:$D$100<>"Wood")))=0textNO
Thank you, i plugged this in and the result for this formula comes back to "FALSE"
 
Upvote 0
That formula is for conditional formatting to highlight the rows that match your criteria.
If that is not what you want, then what do you want?

Also what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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