Hey Victor,

I'd create a Helper Column with this formula and only use your states if the helper is =1.

=COUNTIFS(I$2:I3,I3,E$2:E3,E3)

See attached with the helper column.

Need Helper Column.xlsx