#33 -Find The Differences Between Contents of Two Cells

#33 -Find The Differences Between Contents of Two Cells

Problem description & analysis:

In the following Excel table, cell A1 and cell B1 contain strings made up of vertical line-separated numbers and walled in by vertical lines at both ends:

AB
1|55|56|60|99|120||55|56|62|100|121|130|210|312|

Task: find numbers that exist in A1 but does not exist in B1 and display them in the same format:

D
1|60|99|120|

Solution:

Use SPL XLL to do this:

=spl("=$[|] / (?1.split($[|]) \ ?2.split($[|])).concat($[|])/ $[|]",A1,B1)

As shown in the picture below:

r/esProc_Desktop - Find The Differences Between Contents of Two Cells

Explanation:

The symbol \ computes difference, which are members that are contained in set A but are not contained in set B. Symbol / concatenates two strings. $[] represents a string.

For more related information:

SPL download address: esProc Desktop Download

Plugin Installation Method: SPL XLL Installation and Configuration

References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

SPL Programming (YouTube FREE courses): https://www.youtube.com/playlist?list=PLQeR-IhHo7qNCw6o7PW8YfHvRx8pgzZso