+ Reply to Thread
Results 1 to 6 of 6

How to identify triplet rows among pairs

  1. #1
    Registered User
    Join Date
    12-10-2018
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    19

    How to identify triplet rows among pairs

    Hello Excelforum community,
    How do I identify triplet rows (having a unique identifier 3x) among pairs, and work out some fields on the right?

    The unique identifier here is my BB (b1 was repeated 3x so it's a triplet; b2 is repeated twice so it's a pair)
    For each triplet, I want to identify the earliest and latest timestamp (1 and 3 in this example) and leave the data on the right as it is, but I want to clear out the columns for any row in between (b1c2 here)
    And just ignore the pairs

    The problem is I have many rows and rows, leaving the rows of triplets/pairs far apart from each other. How could I sort them out using some sort of macro?

    rowstime.PNG

    Appreciate any help please.

    *note: Rows with source C have negative values
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to identify triplet rows among pairs

    Have you considered formulas? In column CBP, put a formula that checks the previous row's and next row's BB column, and if both are equal to the current row then make cell blank, otherwise concatenate BB and CC columns. Then for the CB and AA columns, put a formula that will set cell to blank if CBP column is blank, otherwise set to 'Full' or 0 as needed.

    e.g.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-10-2018
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    19

    Re: How to identify triplet rows among pairs

    I would have to code it in vba to work alongside with a longer code that populates CB, CBP and AA... would that be possible? Also previous row and next row won’t cut it because they are actually far apart in the dataset
    Last edited by sotplugy; 07-01-2019 at 09:45 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to identify triplet rows among pairs

    Can you upload the actual spreadsheet? I'm struggling to visualise what it is you are trying to do.

    Are you saying that in column BB, there are thousands of values, all of which are repeated once or twice, but never more? Are some values not repeated?
    Last edited by mgs73; 07-01-2019 at 11:29 PM.

  5. #5
    Registered User
    Join Date
    12-10-2018
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    19

    Re: How to identify triplet rows among pairs

    This is closest to the actual data. Yes, in BB, b1 could appear once, or twice, or thrice, or many times. But there are ways to identify these rows we are interested, resulting in either pairs or triplets only. The actual data is more complicated but I’ve simplified it in this example.

  6. #6
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: How to identify triplet rows among pairs

    I'm still not sure I understand. Are you only interested in items that are in the list three times? Singles, duplicates, and anything else gets left alone?

    If all you want to do is identify triplicates and clear some cells, then try this:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to find the most common pair and triplet numbers in an array?
    By ubatu05 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-14-2021, 08:24 AM
  2. convert the sweepstakes to their palindrome pairs and identify the twin pairs.
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2019, 07:59 AM
  3. [SOLVED] Keep rows between pairs of strings
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2018, 07:04 AM
  4. [SOLVED] Excel 2010 - Identify pairs of rows that have differences in 2 cells
    By Redfang87 in forum Excel General
    Replies: 1
    Last Post: 05-03-2017, 01:31 PM
  5. Identify pairs of values across columns
    By Brainman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-24-2017, 03:56 AM
  6. How to identify duplicates based on multiple cell pairs
    By dhendridge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2011, 05:06 AM
  7. Replies: 5
    Last Post: 10-26-2008, 06:56 PM

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