+ Reply to Thread
Results 1 to 14 of 14

Formula for categorizing and labeling duplicate entry

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Formula for categorizing and labeling duplicate entry

    Folks,

    I was hoping someone could help me out. I will continue trying to solve it, but I think this problem is far beyond my Excel ability, which is poor.

    I have hundreds of cells in Column A, some of which are duplicate cells. Now, I want Column B to indicate whether the entry in Column A is duplicate entry or not. If the entry is duplicate, I want Excel to indicate as much in the first such entry.

    By way of example, this is what I'm hoping the end result will be:

    Individual Existing (Y/N)
    John No
    Jane No
    John Yes


    Please let me know if you guys have any clue how to do this. I'd do it manually but that is a cop out, and I have a range of 1000s of cells.
    Last edited by wishiknewexcel; 03-26-2013 at 06:42 PM. Reason: non-compliant entry

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

    Re: No idea where to start

    wishiknewexcel, welcome to the forum.

    You can start, if you'll excuse the pun by having a quick look at the forum rules, namely # 1 : http://www.excelforum.com/forum-rule...rum-rules.html, and renaming your thread with an appropriate title.
    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
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    Re: No idea where to start

    See if this will work for you.
    Attached Files Attached Files
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: No idea where to start

    Hi WishYouKnew,

    Try this - it assumes that the data above is in Columns A and B:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: No idea where to start

    Hi WishYouKnew,

    Try this - it assumes that the data above is in Columns A and B:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.


    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name

  6. #6
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: No idea where to start

    you guys are amazing. i will try this in a couple hours.

  7. #7
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula for categorizing and labeling duplicate entry

    I attempted to run the macro and it sort of works.

    I think the fault lies with my chart's layout. Here's an extended sample of what my chart looks like (sorry that I cannot provide the file or chart itself):

    NBA Stats
    2006 Season
    Name Existing (Y/N)
    John No
    Girard No
    John Yes
    2007 Season
    Name Existing (Y/N)
    Girard Yes
    Cindy No

    So, let me explain how the macro "somewhat worked." For entries within the same season that were duplicate (e.g., John in the table above) the macro caught them and put in "Yes." However if there were duplicate entries that occurred across seasons (e.g., Girard in the table above), the macro is not recognizing them as duplicative.

    Now, I can't redesign the sheet; I'm stuck with this format. Can we tweak the macro to work around this formatting limitation? I'm sorry that I am so useless—I tried figuring out the coding and making adjustments on my own and that was, in a word, disastrous. I had enough trouble navigating the coding requirements of making the chart!

    If anyone understands and can solve this puzzle, thank you!
    Last edited by wishiknewexcel; 03-30-2013 at 06:30 PM.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula for categorizing and labeling duplicate entry

    I'm testing with a mock-up but I haven't cracked it yet!
    Last edited by xladept; 03-28-2013 at 12:46 AM.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula for categorizing and labeling duplicate entry

    Hi WishYouKnew,

    Try this - same conditions as my first post:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula for categorizing and labeling duplicate entry

    Aright, I'm trying this new macro now—thanks for all your help.

  11. #11
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula for categorizing and labeling duplicate entry

    Well, it looks like this macro is running into similar problems.

    Differences include:
    • Now "Yes" and "No" are being more correctly inserted (last time, I think instead of "No," the cell was just being left blank; this is an improvement)
    • Each of those interruptive rows that introduce new "seasons" are no longer being changed by the macro; previously the macro would change the contents of Column B of all those rows to "Yes." This is another improvement.

    Although the macro still correctly recognize names in Column A within the same SEASON, it still has trouble doing this across seasons. Refer to my earlier post for more detail on this problem.

    Adept—again—thank you for all your help. Let me know if we're just going to raise the white flag here. We fought valiantly but not all Excel battles can be won.

  12. #12
    Registered User
    Join Date
    03-26-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula for categorizing and labeling duplicate entry

    Also, short of asking me to learn Visual Basic, let me know if I can do anything else that is helpful.

  13. #13
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Formula for categorizing and labeling duplicate entry

    Assuming your data starts in A1, try this in B3:
    (revised-)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    drag down

    Hope this helps

    EDIT-
    Posted the formula from B4; Not B3...see revised above
    Last edited by dredwolf; 03-30-2013 at 07:16 PM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  14. #14
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Formula for categorizing and labeling duplicate entry

    Hi Wishi,

    We have only just begun to fight - what's it doing exactly??

    I added another series in the same format and it worked nicely???

    Can you post a sample where it doesn't work???
    Last edited by xladept; 03-31-2013 at 04:37 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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