+ Reply to Thread
Results 1 to 14 of 14

Formula for Finding Duplicate Entries within Multiple Worksheets

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Formula for Finding Duplicate Entries within Multiple Worksheets

    Hi there folks!

    I have a workbook that contains multiple worksheets for each month of the year that all contain a date, a house number, and other various information on shipments. These worksheets are distinguished by month and are organized by least recent to most recent. The sample is below.

    I would really like to create a formula that can go into an added column C (added manually) and check to see if the number in column B is duplicated in any of the other worksheets, and return either the date (column A) or "Not Duplicated". I was thinking a VLookup but I'm not sure.

    So there are two worksheets attached, the first being the original workbook with almost all the months and data, and the second one being what I desire as the outcome. In the second one, July is the month that I chose to put the column in. Any help would be much, much appreciated. I am using Excel 2003 so I am sure that will affect how to write this formula.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    So, for the June sheet you would want to look back into the May sheet, but for July you want to look back into both June and May, and for August you would want to look at sheets July, June and May - is this right?

    And you want to return the first date in a month where there is a duplicate?

    Pete

  3. #3
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Pete,

    As far as looking back, yes. I would like each new sheet to be able to check all of the sheets that were created prior. Sorry I couldn't fit more of the months in, but the 1000 kB limit stopped me. The months go all the way back to the start of the year as a January sheet.

    As far as the date, the first column, column A, has the date that the document was recieved, and that is what I would like to be returned. I should have mixed up the dates a little more, I can see that now.

    Thanks!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    So, will there only ever be one duplicate? If there are more (maybe in different months), which date would you like returned - the earliest or the latest?

    Pete

  5. #5
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Pete,

    There shouldn't be duplicates, but if there are, the most recent date should be returned.

    Thanks!

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Okay, using your Outcome file, and assuming you have inserted a new column C in both the May and June sheets (to keep an identical layout), you could use this formula in C2 of the June sheet:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy this down. For the July sheet you have to nest two IF functions like this in C2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This looks in June first and then in May.

    To apply this to later sheets you would need to do a similar nesting, i.e. copy that formula to C2 of the August sheet and add this part to the beginning of the formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then add a close-bracket to the end. Eventually you will end up with a mammoth formula where you are searching back through 11 sheets.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Thanks Pete! This definitely helps a lot.

    Only one problem though, instead of returning the date in column A as it is, it returns some weird numbers that I would assume are cell assignments?

    For example, it returns 41395 instead of 5/1/2013.

    Any thoughts?

  8. #8
    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: Formula for Finding Duplicate Entries within Multiple Worksheets

    That is how excel see's dates. you just need to format it as date (it means 41395 days from 1/1/1900)
    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

  9. #9
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Ohhhhhhhh makes sense. Thanks FDibbins!

    ...how do I format it? (sorry)

  10. #10
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    GOT IT. All solved! Thanks everyone!

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Glad to be able to help.

    Pete

  12. #12
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Hey so when I go to put it in the original spreadsheet I was sent, it comes up with an error message that describes the problem as "The value was already entered. All Item Numbers must be unique. Pleast try again."

    All I did was create a new column C in June and May, and input this formula:
    Please Login or Register  to view this content.
    Dang it can someone help me out with this error?

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Yes, the same thing happened to me. I thought it was data validation from column B being carried over to the new column C. I just copied another column (e.g. F) into column C, and deleted the contents to retain the formatting, and then put the formula in.

    For other sheets you can just copy that column over first and then add the extra parts, as advised above.

    Hope this helps.

    Pete

  14. #14
    Registered User
    Join Date
    06-12-2013
    Location
    Poughkeepsie, NY
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Formula for Finding Duplicate Entries within Multiple Worksheets

    Pete,

    Yep, totally worked that time. Once again, thank you so much for your help through this formula. Much Obliged.

+ 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. Finding/moving duplicate entries across multiple sheets
    By madbloke in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2013, 02:13 PM
  2. Replies: 1
    Last Post: 01-09-2012, 06:31 PM
  3. [SOLVED] Duplicate entries in multiple worksheets
    By m96 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-04-2006, 07:45 AM
  4. Checking for duplicate entries over multiple worksheets
    By madbloke in forum Excel General
    Replies: 2
    Last Post: 05-11-2006, 07:56 AM
  5. Finding duplicate entries in multiple columns
    By umarazina in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-10-2005, 04:58 AM

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