Might sound crazy But here goes

jimblimm

Board Regular
Joined
May 11, 2012
Messages
219
In cell A1 if have a number
9921

i would like to know which formula i should use to extract the non duplicate digits in the number. the number would display in 2 in b1 and 1 in b2

sometime the number might have 3 duplicate digits

example: 9991

but if the number has 2 sets of duplicate digits
example

9911 i would need to extract the duplicates

example the result would be display 9 in b1 cell and 1 b2
 
i know your question was for it to display in seperate cells. but i could not think of a way to do that.

If this is not what you are looking for i understand, but here is a UDF that will return to you all unique Characters in a string (cell).

Code:
Option Explicit
Function Unique_Char(usrCell As String) As String
Dim strCount As Integer
Dim allUnique As New Collection
Dim i As Integer
Dim single_char As String
Dim result As String
Dim item As Variant
    strCount = Len(usrCell)
    On Error Resume Next
    
    For i = 1 To strCount
        single_char = Mid(usrCell, i, 1)
    
        allUnique.Add item:=single_char, Key:=single_char
    Next i
    For Each item In allUnique
        result = result & item
    Next item
Unique_Char = result
End Function
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top