Home > Back-end >  Excel - Conditional Group By ID
Excel - Conditional Group By ID

Time:06-11

I have the following sample data:

I would like to use a formula or vba to modify the final column by group based on the following conditions:

  • For each id, if any value in the valid column is false, all values in the final column should be false.
  • For each id, if all values in the valid column are true, all values in the final column should be true.
  • For each id, if text is not blank, all values in the final column should be false.

I've tried using index matching:

=$A1=INDEX($A:$A,MATCH("true",$B:$B,0))

But am not sure how to apply this to a group.

The desired result from the sample data would be:

Thank you for any assistance! I am not proficient with Excel and hope to learn from this.

CodePudding user response:

Try this

=NOT(SUMPRODUCT(($A$2:$A$10=A2)*(($B$2:$B$10=FALSE) LEN($C$2:$C$10)>0)))

Screenshot illustrating proposed formula

  • Related