• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Answer for "Find out if a number has repetitive digits" Formula Home work

Kutty

Member
is this correct or not...

IF(IFERROR(FIND(9,A1)<FIND(9,A1,FIND(9,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(8,A1)<FIND(8,A1,FIND(8,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(7,A1)<FIND(7,A1,FIND(7,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(6,A1)<FIND(6,A1,FIND(6,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(5,A1)<FIND(5,A1,FIND(5,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(4,A1)<FIND(4,A1,FIND(4,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(3,A1)<FIND(3,A1,FIND(3,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(2,A1)<FIND(2,A1,FIND(2,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(1,A1)<FIND(1,A1,FIND(1,A1)+1),FALSE)=TRUE,TRUE,IF(IFERROR(FIND(0,A1)<FIND(0,A1,FIND(0,A1)+1),FALSE)=TRUE,TRUE,FALSE))))))))))

please tell me.
 

Attachments

  • 1.jpg
    1.jpg
    244.1 KB · Views: 19
I think it will help you to understand clearly
 

Attachments

  • number-has-repetitive-digits-formula.xlsx
    13.1 KB · Views: 9
Hi ,

A shorter formula , an array formula , would be :

=MAX(FREQUENCY(MATCH(0+MID(A1, ROW(INDIRECT("1:" & LEN(A1))),1),{0,1,2,3,4,5,6,7,8,9},0), {0,1,2,3,4,5,6,7,8,9})) > 1

This is to be entered using CTRL SHIFT ENTER.

A non-array formula would be :

=ISNUMBER(MODE.MULT(MATCH(0+MID(A1, ROW(INDIRECT("1:" & LEN(A1))),1),{0,1,2,3,4,5,6,7,8,9},0)))

Narayan
 
If you copy the MATCH formula block Narayan has demonstrated on the bins_array part of FREQUENCY then the formula will extend capacity to check any duplicate like below (CTRL+SHIFT+ENTER)

=SUM((FREQUENCY(MATCH(MID(A1,ROW($A$1:INDEX(A:A,LEN(A1))),1),MID(A1,ROW($A$1:INDEX(A:A,LEN(A1))),1),0),MATCH(MID(A1,ROW($A$1:INDEX(A:A,LEN(A1))),1),MID(A1,ROW($A$1:INDEX(A:A,LEN(A1))),1),0))>1)+0)>0
 
I'm surprised to see everybody posting their formula in different view. Thanks to Excel Ninjas.
 
Back
Top