check if a number in a cell has duplicate digits

jimblimm

Board Regular
Joined
May 11, 2012
Messages
219
in
a1
1234

a2
1123

a3
2244

a4
4443

a5
5555

i am trying to come up with a formula that will do the following
if the number in cell a1 has no duplicates, b1="s"
if the number in cell a1 has 1 duplicate, it should "1d"
if the number in cell a1 has 2 duplicate, it should "2d"
if the number in cell a1 has 3 duplicate, it should "tc"
if the number in cell a1 has all duplicate, it should "qc"

what im expecting is
b1=s
b2=1d
b3=2d
b4=tc
b5=qc
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
=LOOKUP(SUMPRODUCT(LARGE(FREQUENCY(--MID(A1, {1,2,3,4}, 1), {0,1,2,3,4,5,6,7,8,9}), {1,2}), {10,1}), {11,21,22,31,40}, {"s","1d","2d","tc","qc"})
 
Upvote 0
WOW, i started to post in previous post, but thought it would be something different.
question, (in reference to the sorting post) is there a way to do the same thing alphabetically

a1
hlhl

=

b1 hhll
 
Upvote 0
WOW, i started to post in previous post, but thought it would be something different.
question, (in reference to the sorting post) is there a way to do the same thing alphabetically

A bit late.
This will work:

=LOOKUP(SUMPRODUCT(LARGE(FREQUENCY(CODE(UPPER(MID(A1, {1,2,3,4}, 1)))-65, {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25}), {1,2}), {10,1}), {11,21,22,31,40}, {"s","1d","2d","tc","qc"})
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,052
Latest member
Fuddy_Duddy

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