+ Reply to Thread
Results 1 to 8 of 8

Identify Duplicates and Non-Duplicates within an Array (Match)

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    6

    Identify Duplicates and Non-Duplicates within an Array (Match)

    Hi,

    I am trying to identify a specific non-duplicate value in a list with a variable range within the list. What I need the formula to do is look for "Y", until it finds a "N", then identify the duplicate(s) "Y" in that identified range. Following a "N", when another "Y" has been identified, I need the formula to again look for duplicates in then next range.

    I tried the array formula below, but it counts the number of "Y" and I need the very first "Y" in each "range within a range" to be identified as the first "Y" (or identified as a non-duplicate).

    =IF(COUNTIF(A1:A30,"N"),COUNTIF(A1:INDEX(A1:A30,MATCH(TRUE,A1:A30="N",0)),"Y"),COUNTIF(A1:A30,"Y"))

    In the example below, I would like the first "Y" to be identified as a non-duplicate, the next two "Y" can be either counted or can show as a single number (ex. 1 = duplicate within the range, 0 = non-duplicate). "N" does not necessarily need to be distinguished from "Y", as I believe I can use an if(and statement to separate the "Y" and "N" in another column.

    Y 0
    Y 1
    Y 2
    N -
    Y 0
    N -

    Thank you in advance,

    Jared
    Last edited by simpson11; 02-25-2013 at 05:58 PM. Reason: Problem Solved

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Jared,

    Not entirely sure this is what you want, but if I follow you correctly, you can identify the first instance of "Y", and any "N" values in Column A with:

    Please Login or Register  to view this content.
    in C3, copied down (assuming columns in your post are A & B; just enter "=A2" in C2)

    Then in D2, copied down:

    Please Login or Register  to view this content.
    will identify the "duplicate values" within each range from Column B.

    Is this along the lines of what you had in mind?
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Brendan,

    Thank you so much for the fast reply. Your solution would work fine, but I left out one key piece of information - there are blank cell between many of the "Y" and "N". I can add a third variable for the blank cells, but I'm afraid this would require a lot of If statements. (there are cases where there are more than 30 blank spaces before the next yes or no).

    Thank you again,

    Jared

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Jared,

    If you want to upload a sample workbook containing an accurate sample of the data you're dealing with, I'll have another look.

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Hi Brendan,

    I have attached an example spreadsheet.

    In column "C" I need the percentage from column "A" only for the first "Y" in each series.
    As an alternative, counting the duplicate "Y" in each series, I can then use a simple formula to pull the correct percentages over to the next column.

    In column "D", there are the examples of the percentages/non-duplicate indicators that I would need (it is alright for "N" to be counted).

    Thank you again,

    Jared
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Jared,

    Please see attached. I almost lost the will to live, trying to solve this - Excel doesn't generally play nice with gaps in data, or perhaps: it's better to avoid gaps in data where possible, is a better way to say that. However, just as I was about to give up, I had another look at my original post to you, and had a eureka moment. My solution requires the use of 2 helper columns, and a third to return the results you're looking for - provided you can live with that, you're good to go.

    Hope this helps.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-19-2012
    Location
    Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Hi Brendan,

    Thank you so much for finding the solution to my problem! The two helper columns work great and I am able to get the answers that I need.

    Thanks again,

    Jared

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Identify Duplicates and Non-Duplicates within an Array (Match)

    Jared,

    Glad I could help, and thanks for the rep.

    Could you please use the thread tools to mark this thread as "Solved", provided of course that you're happy it is?

    Thanks,

+ 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