Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: 提取个尾的尾组合(Extract the tail "tail" combination)

  1. #1
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    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

  2. #2
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: 提取个尾的尾组合(Extract the tail "tail" combination)

    各位老师,由于我不太懂英文,只能用中文提问了,辛苦各位老师!

  3. #3
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    3,826
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

    Default Re: 提取个尾的尾组合(Extract the tail "tail" combination)

    what do you expected in H with this set of data?

    ABCDEFG
    1
    2101102103104105106109

    Sheet4




  4. #4
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    A B C D E F G H I
    1
    2 101 102 103 104 105 106 109 36 45






    中文解释:
    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

  5. #5
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    3,826
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

    Default 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

    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),"")

    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))),"")}
    Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
    Note: Do not try and enter the {} manually yourself


  6. #6
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    3,826
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

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

    I'd reposted your Q in English here

    https://www.mrexcel.com/forum/excel-...ml#post5284315

  7. #7
    MrExcel MVP
    Join Date
    Jan 2008
    Posts
    14,837
    Post Thanks / Like
    Mentioned
    26 Post(s)
    Tagged
    12 Thread(s)

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

    Try this:-
    Data assumed to start "A1"
    Code:
    Sub MG28May05
    Dim Rng As Range, Dn As Range, Num As Long, Ac1 As Long, Ac2 As Long, Col As Long
    Set Rng = Range("A1", Range("A" & Rows.Count).End(xlUp))
    
    For Each Dn In Rng
    Col = 6
    Num = Right(Dn.Offset(, 6), 1)
    For Ac1 = 0 To 5
        For Ac2 = Ac1 + 1 To 5
            If Val(Right(Dn.Offset(, Ac1), 1) + Val(Right(Dn.Offset(, Ac2), 1))) = Num Then
                Col = Col + 1
                Dn.Offset(, Col) = Right(Dn.Offset(, Ac1), 1) & Right(Dn.Offset(, Ac2), 1)
            End If
        Next Ac2
    Next Ac1
    Next Dn
    End Sub
    Regards Mick

  8. #8
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    chaina中文:
    目前VBA很懂不是
    模拟题目,的英文答案正确的
    假设模拟题目一:F区域中数字有102212115,那根据VBA计算结果就是25/25
    遇到这种情况,最终重复的只保留一个就可以。
    如果能用公式最好,VBA我基本上搞不太懂。
    非常感谢你的帮助!

    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!

  9. #9
    New Member
    Join Date
    May 2019
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    Quote Originally Posted by AlanY View Post
    this is what I came up with but with so many helping rows and columns I doubt that this is what you're after

    A B C D E F G H I J
    1 101 102 103 104 105 106 107 16 25 34
    2 3 4 5 6 7 16
    3 5 6 7 8 25
    4 7 8 9 34
    5 9 10
    6 11
    Sheet4

    Worksheet Formulas
    Cell Formula
    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),"")

    Array Formulas
    Cell Formula
    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))),"")}
    Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
    Note: Do not try and enter the {} manually yourself
    Chaina中文:
    瞬间感觉国外的朋友特别热心。
    首先非常感谢你热心的解答。
    公式计算过程与计算结果都没有问题的。
    其次,A:G纵向区域,是数据源,所以计算过程只能横向计算。
    =IFERROR(ROW(A2)-ROW($A$1)&MATCH(RIGHT($G$1,1)+0,A2:F2,0),"")
    我刚才横向测试的时候,这条公式计算结果是15,不清楚哪里出错了。

    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.

  10. #10
    Board Regular
    Join Date
    Oct 2014
    Location
    UK
    Posts
    3,826
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)

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

    have you entered the formula with shift-control-enter?

    have a look of the file in

    https://drive.google.com/file/d/18uR...ew?usp=sharing
    Last edited by AlanY; May 28th, 2019 at 08:04 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •