提取个尾的“尾”组合(Extract the tail "tail" combination)

q771021738

New Member
Joined
May 28, 2019
Messages
13
EXCEL表格:https://1drv.ms/x/s!AiDf3QxUtCLkavUxZeMNKZL7DRM

题目:
①计算结果以H2为首个单元格
②计算过程如下:
(1)在G:G区域,数值取尾
(2)A2:F2区域,尾数分别相加,结果取尾
(3)假设RIGHT(A2 + B2)= RIGHT(G2)则把A2与B2的尾数,同放在一个单元格
③组合去重复:例如G4取尾是0 ,A4:F4区域,尾数相加等于0的,只有4和6,有两个4,因此形成46 46两个组合,最终保留一个46组合就可以
④A2:F2例举:
(1)G2是135取尾是5
(2)在A2:F2中,两个尾相加,然后取尾的,只有右(D2 + E2)=右(G2),D2尾是5,E2尾是0,则最终提取05尾,顺序没要求
(3)由以上,得出符合条件的组合是:“05”
 

q771021738

New Member
Joined
May 28, 2019
Messages
13
各位老师,由于我不太懂英文,只能用中文提问了,辛苦各位老师!
 

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
3,826
what do you expected in H with this set of data?

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">101</td><td style="text-align: right;;">102</td><td style="text-align: right;;">103</td><td style="text-align: right;;">104</td><td style="text-align: right;;">105</td><td style="text-align: right;;">106</td><td style="text-align: right;;">109</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet4</p><br /><br />
 

q771021738

New Member
Joined
May 28, 2019
Messages
13
Re: 提取个尾的“尾”组合(Extract the tail "tail" combination)

ABCDEFGHI
1
21011021031041051061093645

<tbody>
</tbody>






中文解释:
G2取尾是9
A:F区域,任意两个尾数相加的和值,取尾;与G2的尾相同,则把相通的两位数提取
假设出现多个相同的尾数,则保留一个

Google Translate:
G2 tail is 9
A: F area, the sum of any two mantissas, and the tail; the same as the tail of G2, the two-digit number of the same is extracted
Assuming multiple identical mantissas, keep one
 

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
3,826
Re: 提取个尾的“尾”组合(Extract the tail "tail" combination)

this is what I came up with but with so many helping rows and columns I doubt that this is what you're after

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th><th>J</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;;">101</td><td style="text-align: right;;">102</td><td style="text-align: right;;">103</td><td style="text-align: right;;">104</td><td style="text-align: right;;">105</td><td style="text-align: right;;">106</td><td style="text-align: right;;">107</td><td style="text-align: right;background-color: #DDEBF7;;">16</td><td style="text-align: right;background-color: #DDEBF7;;">25</td><td style="text-align: right;background-color: #DDEBF7;;">34</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;">3</td><td style="text-align: right;background-color: #E2EFDA;;">4</td><td style="text-align: right;background-color: #E2EFDA;;">5</td><td style="text-align: right;background-color: #E2EFDA;;">6</td><td style="text-align: right;background-color: #E2EFDA;;">7</td><td style="text-align: right;background-color: #FFF2CC;;">16</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;">5</td><td style="text-align: right;background-color: #E2EFDA;;">6</td><td style="text-align: right;background-color: #E2EFDA;;">7</td><td style="text-align: right;background-color: #E2EFDA;;">8</td><td style="text-align: right;background-color: #FFF2CC;;">25</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;">7</td><td style="text-align: right;background-color: #E2EFDA;;">8</td><td style="text-align: right;background-color: #E2EFDA;;">9</td><td style="text-align: right;background-color: #FFF2CC;;">34</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;">9</td><td style="text-align: right;background-color: #E2EFDA;;">10</td><td style="text-align: right;background-color: #FFF2CC;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;"></td><td style="text-align: right;background-color: #E2EFDA;;">11</td><td style="text-align: right;background-color: #FFF2CC;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet4</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B2</th><td style="text-align:left">=RIGHT(<font color="Blue">$A$1</font>)+RIGHT(<font color="Blue">B1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">C3</th><td style="text-align:left">=RIGHT(<font color="Blue">$B$1</font>)+RIGHT(<font color="Blue">C1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D4</th><td style="text-align:left">=RIGHT(<font color="Blue">$C$1</font>)+RIGHT(<font color="Blue">D1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">E5</th><td style="text-align:left">=RIGHT(<font color="Blue">$D$1</font>)+RIGHT(<font color="Blue">E1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">F6</th><td style="text-align:left">=RIGHT(<font color="Blue">$E$1</font>)+RIGHT(<font color="Blue">F1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">G2</th><td style="text-align:left">=IFERROR(<font color="Blue">ROW(<font color="Red">A2</font>)-ROW(<font color="Red">$A$1</font>)&MATCH(<font color="Red">RIGHT(<font color="Green">$G$1,1</font>)+0,A2:F2,0</font>),""</font>)</td></tr></tbody></table></td></tr></table><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">H1</th><td style="text-align:left">{=IFERROR(<font color="Blue">INDEX(<font color="Red">$G$2:$G$6,SMALL(<font color="Green">IF(<font color="Purple">1-(<font color="Teal">$G$2:$G$6=""</font>),ROW(<font color="Teal">$G$2:$G$6</font>)-ROW(<font color="Teal">$G$2</font>)+1</font>),COLUMN(<font color="Purple">H:H</font>)-COLUMN(<font color="Purple">$G:$G</font>)</font>)</font>),""</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

MickG

MrExcel MVP
Joined
Jan 9, 2008
Messages
14,841
Re: 提取个尾的“尾”组合(Extract the tail "tail" combination)

Try this:-
Data assumed to start "A1"
Code:
[COLOR="Navy"]Sub[/COLOR] MG28May05
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, Num [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Ac1 [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Ac2 [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Col [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range("A1", Range("A" & Rows.Count).End(xlUp))

[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
Col = 6
Num = Right(Dn.Offset(, 6), 1)
[COLOR="Navy"]For[/COLOR] Ac1 = 0 To 5
    [COLOR="Navy"]For[/COLOR] Ac2 = Ac1 + 1 To 5
        [COLOR="Navy"]If[/COLOR] Val(Right(Dn.Offset(, Ac1), 1) + Val(Right(Dn.Offset(, Ac2), 1))) = Num [COLOR="Navy"]Then[/COLOR]
            Col = Col + 1
            Dn.Offset(, Col) = Right(Dn.Offset(, Ac1), 1) & Right(Dn.Offset(, Ac2), 1)
        [COLOR="Navy"]End[/COLOR] If
    [COLOR="Navy"]Next[/COLOR] Ac2
[COLOR="Navy"]Next[/COLOR] Ac1
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 

q771021738

New Member
Joined
May 28, 2019
Messages
13
Re: 提取个尾的“尾”组合(Extract the tail "tail" combination)

chaina中文:
目前VBA很懂不是
模拟题目,的英文答案正确的
假设模拟题目一:F区域中数字有102212115,那根据VBA计算结果就是25/25
遇到这种情况,最终重复的只保留一个就可以。
如果能用公式最好,VBA我基本上搞不太懂。
非常感谢你的帮助!
[HR][/HR]Google Translate:
Currently VBA is not very understanding
Simulation question, the answer is correct
Suppose the simulation problem A: The number in the F area is 102, 212, 115, then the result is 5/25 according to the VBA calculation.
In this case, only one of the last duplicates can be retained.
If I can use the formula best, I basically don't understand VBA.
thank you very much for your help!
 

q771021738

New Member
Joined
May 28, 2019
Messages
13
Re: 提取个尾的“尾”组合(Extract the tail "tail" combination)

this is what I came up with but with so many helping rows and columns I doubt that this is what you're after

ABCDEFGHIJ
1101102103104105106107162534
23456716
3567825
478934
5910
611

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Worksheet Formulas
CellFormula
B2=RIGHT($A$1)+RIGHT(B1)
C3=RIGHT($B$1)+RIGHT(C1)
D4=RIGHT($C$1)+RIGHT(D1)
E5=RIGHT($D$1)+RIGHT(E1)
F6=RIGHT($E$1)+RIGHT(F1)
G2=IFERROR(ROW(A2)-ROW($A$1)&MATCH(RIGHT($G$1,1)+0,A2:F2,0),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
H1{=IFERROR(INDEX($G$2:$G$6,SMALL(IF(1-($G$2:$G$6=""),ROW($G$2:$G$6)-ROW($G$2)+1),COLUMN(H:H)-COLUMN($G:$G))),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
Chaina中文:
瞬间感觉国外的朋友特别热心。
首先非常感谢你热心的解答。
公式计算过程与计算结果都没有问题的。
其次,A:G纵向区域,是数据源,所以计算过程只能横向计算。
=IFERROR(ROW(A2)-ROW($A$1)&MATCH(RIGHT($G$1,1)+0,A2:F2,0),"")
我刚才横向测试的时候,这条公式计算结果是15,不清楚哪里出错了。
[HR][/HR]Google Translate:
Instantly feel that foreign friends are particularly enthusiastic.
First of all, thank you very much for your enthusiastic answer.
There is no problem with the formula calculation process and the calculation results.
Secondly, the A:G vertical area is the data source, so the calculation process can only be calculated horizontally.
=IFERROR(ROW(A2)-ROW($A$1)&MATCH(RIGHT($G$1,1)+0,A2:F2,0),"")
When I was testing horizontally, this formula calculated 15 and it was not clear what went wrong.
 

Forum statistics

Threads
1,077,780
Messages
5,336,257
Members
399,073
Latest member
fairoos

Some videos you may like

This Week's Hot Topics

Top