Find rows with same ID and follow certain conditions

qhont

New Member
Joined
Jul 26, 2022
Messages
4
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I have a data set where there are multiple rows with the same ID#. If both DATA_A and DATA_B are "Y" for each of the same ID#'s I want it to return "1" (Like ID#002 below). If there is one "N" I want it to return "0" for each row with that ID# (Like ID#003 below).
ABCDEF
1IDDATA_ADATA_BWhat I want it to returnIgnore this column
2001NY01
3002YY11
4002YY11
5003NN01
6003YY01
7003YY01
8004YY11

I attempted to do =MAXIFS($F$2:$F$8,$B$2:$B$8,B2,$C$2:$C$8,"Y",$D$2:$D$8,"Y") ,but this would return 1 for ID#003 when I don't want that.
If anyone is able to suggest any other formulas to try or thought processes I'd greatly appreciate it!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi & welcome to MrExcel.
My take on this
Fluff.xlsm
ABCDE
11IDDATA_ADATA_BWhat I want it to return
221NY0
332YY1
442YY1
553NN0
663YY0
773YY0
884YY1
Report
Cell Formulas
RangeFormula
E2:E8E2=--(SUMPRODUCT(($B$2:$B$10=B2)*(($C$2:$C$10="n")+($D$2:$D$10="n")))=0)
 
Upvote 0
Solution
Hi & welcome to MrExcel.
My take on this
Fluff.xlsm
ABCDE
11IDDATA_ADATA_BWhat I want it to return
221NY0
332YY1
442YY1
553NN0
663YY0
773YY0
884YY1
Report
Cell Formulas
RangeFormula
E2:E8E2=--(SUMPRODUCT(($B$2:$B$10=B2)*(($C$2:$C$10="n")+($D$2:$D$10="n")))=0)
Thanks so much Fluff!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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