There are two primary forms of function that compare the presence of numbers in two strings. Both the functions evaluate whether each string contains the same digit values and the same count of each digit value.
The differentiation between the two forms of comparison is that
- one requires the order in which they appear in the string to be identical
- the other only reviews the presence of a digits in the correct number of instances
The two tables below look at how we might compare various strings that contain similar number values - initially irrespective of order then including order. Column 4 of the tables shows the answer that would have been generated had we used the alternative comparison function.

Remarks
In other words if two strings are required to have a single instance of the numbers 1 to 6 then both must exhibit this property. No duplicates or substitutions of any of the six values are permitted.
See also
Worksheet Functions or Formulae