Please separate the first 4 last digits and rank in the 24 patterns.

jack

Member
Please separate the first 4 last digits and rank in the 24 patterns,
These 24 patterns have for each position the largest and smallest digits
* Ex = 8,5,2 7 = we have 4,2,1,3 because 4 in 1 position? Because it's the biggest digit
Why is the digit 1 in the 3rd position? Because the digit 2 is the smallest,
Objective = in standard and position the largest and smallest digit
sometimes it repeats a digit to consider smaller
 

jack

Member
we have 24 patterns
each pattern, represents, within the 4 positions
higher, lower, lower mean, higher mean
ex = 8529 = equals = 3214 note that the largest and smallest digit
is in the 4th and 3rd position respectively
 

Frank

Member
This is the best I can do in the time available. There is a problem with duplicated second digits which do not fit your pattern since then their size order is duplicated too. I'm away soon, so no point in asking me for immediate help. Hopefully this will be sufficient.
http://www.mediafire.com/file/kt8f5cxc3s19kt3/24_padroes.xlsx/file
 

jack

Member
ok FRANk, thank you!
Assuming I understood, here's how I did it:

1) Especially while developing an algorithm I like to see each step of the calculation, so I inserted 5 columns so I could see the intermediate step.
2) I used the RANK() function to get the rank of each digit in column I:L =RANK(I5,$I5:$L5,1). Note the mix of relative and absolute references.
3) You asked for a part to deal with duplicates, so I added a COUNTIFS() to the formula to account for duplicates COUNTIFS($I5:I5,I5). Then subtract 1 -- =RANK(I5,$I5:$L5,1)+COUNTIFS($I5:I5,I5)-1 [entered into N5]. Copy down and across to Q25.
4) Combine numbers into a text string that looks like the text strings in row 4. I used a UDF that mimics the TEXTJOIN() function https://support.office.com/en-us/art...3-0e8fc845691c I don't know if you have access to the TEXTJOIN() function or if you will need to use a regular CONCATENATE() function or & operator =TEXTJOIN($N5:$Q5,",") or =CONCATENATE($N5,",",$O5,",",$P5,",",$Q5,",") [entered in R5]
5) From here, it is a simple IF() function: =IF($R5=S$4,"x","-") [entered in S5 and copied down and across).
 

Sidebar

Top