Excel Formula - Aggregate rows by ignoring duplicated values in another column

debster

I have a table as below:

enter image description here

I want to populate the Aggregate column by doing a cumulative sum based on ID and Code column. Some of the rows have duplicated values, like row 2 and row 4, row 3 and row 5 etc. So that I can show that ID 1 has 2 unique codes, ID 2 has 3 unique codes etc.

I have tried this formula but it doesn't yield what I want.

=COUNTIFS($B$2:B2,B2,$A$2:A2,A2)

My desired output is as below:

enter image description here

Scott Craner

With FILTER in Office 365, put this in C2 and copy down:

=@FILTER($C$1:C1,($A$1:A1=A2)*($B$1:B1=B2),MAXIFS($C$1:C1,$A$1:A1,A2)+1)

enter image description here


If one does not have Office 365:

=IFERROR(INDEX($C$1:C1,AGGREGATE(15,7,ROW($C$1:C1)/(($A$1:A1=A2)*($B$1:B1=B2)),1)),IFERROR(AGGREGATE(14,7,$C$1:C1/($A$1:A1=A2),1),0)+1)

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Removing rows with duplicated column values based on another column's value

Excel Formula to count rows in a column when a criteria is met in another column

Aggregate values in rows conditional on values in another column using r

Pandas Dataframe: removing duplicated rows with ignoring one specific column

Pandas - Find duplicated entries in one column within rows with equal values in another column

Remove all the rows having same column values of another column which is duplicated

Rename duplicated column values group by another column

Filling a column with the amount of duplicated values in another column

Excel formula - How to conditionally fill a column with values from another table

To show the aggregate of duplicated values that another corresponding attribute in another table is NOT NULL

Sum values of a single column in duplicated rows in R

Merge dataframes based on column values with duplicated rows

How to remove duplicated rows based on values in column

filtering duplicated rows with maximum values in a column with NAs

Combine duplicated rows by unique values in column to fill blank columns in another value

Merge Values of Columns if Another Column is Duplicated

Column to aggregate values in another one

aggregate column values into list ignoring the None values in pandas dataframe

Google sheet array formula to allocate values to rows based on index in another column over blank rows

Excel - formula counting the number of distinct values in column, without taking into account the indicated values from another column

Aggregate rows in MySQL ignoring NULL values into a single row

aggregate toString ignoring NA values / Concatenate rows including NAs

Formula to check if rows that have the same value in one column have matching values in another column

Deleting rows that are duplicated in one column based on the conditions of another column

Deleting rows that are duplicated in one column based on value in another column

excel vba: copy rows if data match with values in column in another sheet

Aggregate column in dataframe by values of another column?

Aggregate only rows based on values of another columns

Excel formula for counting the number of rows away from TRUE event in another column