Home > Back-end >  I need to get the first value of a group of duplicates in a column in Excel, even if they are repeat
I need to get the first value of a group of duplicates in a column in Excel, even if they are repeat

Time:10-18

I have some data which I need to reformat in excel. The first column has names that are sorted in ascending order. The second column has additional details that are associated with each name, and they are in groups of duplicates. What I need is to get the first value of each group of duplicates, even if there is more than one instance of the duplicate value.

I tried the following formula in K4, but it only returns the first instance of the duplicate value and ignores all others

=IF(COUNTIF($A2:$A$19, $A2)>1, IF(COUNTIF($A$2:$A2, $A2)=1, A2,""), "")

The second part is to be able to populate the cost and discount price for the product interest based on the associated month.

I am open to all options for achieving the output needed in the attached picture and appreciate any help you can provide.

Excel Sheet

CodePudding user response:

J3  =IF(B3=B2;"";B3)
K3  =IF(B3&C3=B2&C2;"";C3)
L3  =IF(B3&D3<>B2&D2;D3;"")
M3  =E3
N3  =IF(A3=$N$1;F3;0)
O3  =IF(A3=$N$1;G3;0)
P3  =IF(A3=$P$1;F3;0)
Q3  =IF(A3=$P$1;G3;0)

enter image description here

  • Related