#37 — Replace Duplicate Items with The Specified Text

Problem description & analysis:

In the Excel table below, the 1st column contains sequence numbers and the 2nd column has duplicate values.

original table

Task: Record the value appearing for the first time in the 2nd column and replace its duplicates with the string “cont.”.

desired table

Solution:

Use SPL XLL to enter the following formula:

=spl("=((d=E(?))\d.group@1(Date)).(Date=$[cont.]),d",A1:B8)
Enter fullscreen mode

As shown in the picture below:

result table with code entered
Explanation:

E() function converts the data range to a two-dimensional table. group@1 groups rows and retrieves the 1st row of each group. The operator \ finds the difference of two sets.


Discover more from Coursity

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Discover more from Coursity

Subscribe now to keep reading and get access to the full archive.

Continue reading

Scroll to Top
To turn on screen reader adjustments at any time, users need only to press the alt+1 keyboard combination. Blog – foreelo web design & seo digital marketing experts.