+ Reply to Thread
Results 1 to 9 of 9

Sequence Conundrum

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Sequence Conundrum

    Hi All,

    In the attached sheet I have 2 columns of data, GL Code and TB Group. I would like to put a formula in a 3rd column that concatinates the TB Group field with the number of unique GL Codes within that group so far as the rows progress. The concept is simple but the formula does not appear to be. This is a small sample of data but I need to apply this to a lrage piece of data.

    see attachment for example

    Thanks very much for your help

    Ciaran
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sequence Conundrum

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    DaveDeV
    Guest

    Re: Sequence Conundrum

    Hi Ciaran,

    Try this formula in Column C of your example:

    =B2&RIGHT(FIXED(A2,0,TRUE),1)

    This formula takes the "TB Group" value and appends it (using "&") with the right-most character (using "RIGHT") of the "GL Code" (after converting the numeric value to a text string (using "FIXED"). The "TRUE" is to eliminate commas and the "1" is a parameter for RIGHT specifying a single character.

    I hope that helps...

    PS: if, in some cases you need 2 characters instead of 1, this won't work.

    Dave

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sequence Conundrum

    Thanks oeldere, the right character on the GL code field containing the correct numbers is purely cooincidental, nice spot but that wont work

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sequence Conundrum

    In that chase you have to add more informations how the data are related.

    Shows it to us in your excel file.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Sequence Conundrum

    Dave, just fyi, left/mid/right convert numbers to text, so you didnt need the rest of that, just...
    =B2&RIGHT(A2,1)

    ciaran if your sample data does not represent your actual data, I suggest you change it to something that more accurately shows what you are working with

    because based on what you showed =B2&RIGHT(A2,1) gives you exactly what you said you wanted
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sequence Conundrum

    Thanks Dibbins, I have reattached. Hope this makes sense now. Thanks and have a great weekend
    Attached Files Attached Files

  8. #8
    DaveDeV
    Guest

    Re: Sequence Conundrum

    Ciaran,

    Now you've really confused the h*ll out of me...

    From your latest attachment, it appears as if your requirement is as follows:

    1) There are two independent and unordered sequences of values in which duplicates can and do occur
    2) For each permutation of a pairing between the two columns, a third column needs to be populated with a computed value
    3) The computed value in column 3 is a compound value comprising two components in the form XXXX-YY where:
    a) XXXX = your "TB Group"
    b) YY =an incremented number starting from 01 to reflect the incidence number of a particular "TB Group" pairing with any "GL Code"
    4) Once a unique pairing has occurred, any further occurrences of a previously paired combination must be given the same suffix as the initial occurrence

    NB: I've catered for a maximum of 99 matches per "TB Group" - if this is inadequate, we may need to change form of column 3 value to XXXX-YYY

    Is the above correct interpretation?

    Dave

  9. #9
    Registered User
    Join Date
    11-16-2012
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Sequence Conundrum

    Thanks Dave, I have managed to get it to work, all be in using a bunch of columns, see attached

    Col C Counts the number of "GL Codes" within the rows "TB Group". If its greater than 1, its assigned a "DUPE" status.
    Col D and E then counts number of "DUPES" so far in the data
    Col F then subtracts the duplicates from Col C, leaving the number of unique GL Codes per TB Group so far

    Apologies all if I didnt explaing this one vey well before, tricky to get my head around.
    The numbers are then used in a vloohup downstream giving me the fisrt, second, third match etc

    It would be nice to get the desired result within the same column but given the headache this one caused I may just leave it

    Thanks all for help and interest

    Ciaran Mc
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1