+ Reply to Thread
Results 1 to 8 of 8

Count duplicates and duplicates with suffix as one instance

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Count duplicates and duplicates with suffix as one instance

    Hi again forum extraordinaires

    I have a list of isometric drawing numbers ending with a [underscore]weld number e.g. 1692-SG-0040-04_05.

    Some welds are repaired--in that scenario the amended weld number will be 1692-SG-0040-04_05R1, and even 1692-SG-0040-04_05R2 if repaired for a second time.

    On occasion a weld may be cut out entirely and a new weld done. The weld number for that will be 6317-FG-1690-02_06C1.

    And here's a wrinkle I've just verified...a cut weld may also be repaired so the weld number will look like 1698-SG-0077-01_04C1R1.

    Is there a formula to count these as one weld:
    1692-SG-0040-04_05
    1692-SG-0040-04_05R1
    1692-SG-0040-04_05R2

    This as one weld:
    6317-FG-1690-02_06
    6317-FG-1690-02_06C1
    6317-FG-1690-02_06C2

    ...and this as one weld:
    1698-SG-0077-01_04
    1698-SG-0077-01_04C1
    1698-SG-0077-01_04C1R1
    Last edited by ruraljur0r; 03-23-2014 at 12:42 AM. Reason: Pressed enter too early while post was incomplete

  2. #2
    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,929

    Re: Count duplicates and duplicates with suffix as one instance

    If your data is in column A, try this, copied down....
    =COUNTIF($A$1:$A$13,LEFT(A1,FIND("_",A1,1)-1)&"*")
    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

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Count duplicates and duplicates with suffix as one instance

    Hi Ford
    I copied your solution to my spreadsheet but the results aren't producing what I need, see attached file.
    Attached Files Attached Files

  4. #4
    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,929

    Re: Count duplicates and duplicates with suffix as one instance

    Im not sure why...
    A2=100789-D-G01_01
    A3=100789-D-G01_01
    A4=100789-D-G01_01
    all get 0
    but 100789-D-G01_01
    gets 1?

  5. #5
    Registered User
    Join Date
    02-13-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Count duplicates and duplicates with suffix as one instance

    Because the weld on the same drawing number, no matter how many times it appears, counts as one weld--even if it's been repaired or cut out.

    Hope that clarifies it better :-)

  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,929

    Re: Count duplicates and duplicates with suffix as one instance

    They all look the same to me....
    100789-D-G01_01...A2
    100789-D-G01_01...A3
    100789-D-G01_01...A5
    all get 0
    100789-D-G01_01...A5
    What am I missing?

    I tried this, copied down...
    =IF(A2=A3,0,IF(LEFT(A3,FIND("_",A2,1)-1)=LEFT(A2,FIND("_",A2,1)-1),0,1))

    But it still does not give ehat you want...I just dont get the logic

  7. #7
    Registered User
    Join Date
    02-13-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Count duplicates and duplicates with suffix as one instance

    How's this...
    On drawing 100789-D-G01 weld 01 has been completed but for whatever reason has been duplicated four times in a list. As far as I'm concerned this is one weld.

    Same for drawing 1692-SG-0018-03. Weld 15 was completed and also repaired. The repair is noted as 15R1. These are both one weld.

    And again for drawing 1692-SG-0040-04. Weld 05 was completed and repaired twice (05R1 and 05R2). All these are one weld.

    For drawing 1698-SG-0047-02 weld 01 was cut out. This is noted as 01C1 and this is also classed as one weld.

    On the rare occasion a cut weld may be repaired. So (making up a drawing number that's not in my spreadsheet) drawing 1698-SG-0013-02 weld 01 cut once and repaired once will be noted as 01C1R1.

    I'm thinking if there was a way to look at cell contents for the two characters immediately to the right of _ and compare that with contents of the next cell down. If they're the same then 0, otherwise 1.

    I've been going over this for days and it's doing my head in

  8. #8
    Registered User
    Join Date
    02-13-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Count duplicates and duplicates with suffix as one instance

    I think I've found the answer!

    =IF(LEFT(A2,FIND("_",A2)+2)=LEFT(A3,FIND("_",A3)+2),0,1)

    On reviewing the data I need to verify a few drawing and weld numbers e.g. 100789-D-G01_01 vs 100-789-D-G01_01 but for the most part the results are what I'm looking for.

+ 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. [SOLVED] To find duplicates in a column and suffix them with numbers to make them unique
    By JishnuSurendran in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2014, 06:34 AM
  2. Highlighting all duplicates except the last instance
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2013, 06:57 PM
  3. highlight all duplicates EXCEPT first instance
    By Blake 7 in forum Excel General
    Replies: 7
    Last Post: 04-27-2012, 01:33 AM
  4. Replies: 6
    Last Post: 03-29-2012, 12:16 AM
  5. Replies: 3
    Last Post: 03-09-2011, 07:00 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