Repeated Digits in a CELL

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,522
Office Version
  1. 2016
Platform
  1. Windows
Dear All,

I am using this formula for repeated numbers in a range

=IF(COUNTIF(A1:I1,0)>1,"0","")&SUBSTITUTE(SUM((COUNTIF(A1:I1,{1,2,3,4,5,6,7,8,9})>1)*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")

i need a formula for Repeated Digits in a cell

Regards,

Humayun

 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Dear Pgc01

First of all Thanks for your reply

secondaly, dear what i require is a result which shows only repeated digits in a cell - whereas, the formula which you just posted is not matching the requirement

i have entered 56225 in CELL A1
the formula result should be 25

whereas, the result which i am currrently getting from your formula is 256

Awaiting reply,

Humayun
 
Upvote 0
Sorry, you are right, I did not read your post with attention and my formula is showing all the digits in A1, not just the repeated ones.

To get only the repeated ones, try, for ex.:

=IF(ISNUMBER(SEARCH(0&"*"&0,A1)),"0","")&SUBSTITUTE(SUMPRODUCT(ISNUMBER(SEARCH({1,2,3,4,5,6,7,8,9}&"*"&{1,2,3,4,5,6,7,8,9},A1))*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")
 
Upvote 0
Dear Pgc01

Wow - FANTASTIC..... Worked PERFECT..

Thanks a Lot..

now the last problem for a cell is left. can we just modify this formula for Unique Numbers in a CeLL..

sorry i will post a new thread in a minute for this matter so that everyone should get help from it..

Pls see my new thread in a minute..

THREAD > UNIQUE DIGITS IN A CELL
 
Upvote 0
Humayun, I'm glad it helped.

Since you want both the unique and the repeated digits, you can use another formula for the repeated ones. That makes the 2 formulas similar

Unique digits:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,0,""))=1,"0","")&SUBSTITUTE(SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},""))=1)*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")

Repeated digits:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,0,""))>1,"0","")&SUBSTITUTE(SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},""))>1)*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")
 
Upvote 0
Thanks PGC01

Thanks for your time and support...

It really helped me a LOT

GOD BLESS U

Regards,

Humayun Rayani
 
Upvote 0
Dear PGC01

As For the missing Digits i have just modified your formula of Unique numbers

I have changed the = sign to < less then sign

now all three formulas are the same

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,0,""))<1,"0","")&SUBSTITUTE(SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},""))<1)*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")
 
Upvote 0
Dear PGC01

As For the missing Digits i have just modified your formula of Unique numbers

I have changed the = sign to < less then sign

now all three formulas are the same

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,0,""))<1,"0","")&SUBSTITUTE(SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{1,2,3,4,5,6,7,8,9},""))<1)*{1,2,3,4,5,6,7,8,9}*10^{8,7,6,5,4,3,2,1,0}),0,"")

Yes, it's a nice solution. All the formulas similar.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,786
Members
452,942
Latest member
VijayNewtoExcel

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