+ Reply to Thread
Results 1 to 10 of 10

Countif across workbooks

  1. #1
    Registered User
    Join Date
    10-01-2010
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Countif across workbooks

    Hi,

    I have a project with 2 million rows of data (13 digit numbers, single column). I need a method to find duplicates among this population. But I'm not sure how to run a countif function because Excel 2013 limits rows to a little over 1 million and hence my data is in two workbooks to maintain some sanity. I did search the forum for a similar problem, but failed to find one. Please be kind.
    Last edited by vivekmartin; 06-13-2013 at 04:41 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Countif across workbooks

    OK, a lot of numbers. But why two workbooks? Why not two worksheets or even just two columns?

    In the following example, I have a 5 x 5 matrix with some duplicates:

    HTML Code: 

    The formula in cell H1 is =COUNTIF($A$1:$E$5,A1)

    So, assuming your data was in a two column matrix on a single sheet, you could use that in a secondary matrix or use: =COUNTIF($A$1:$E$5,A1)>1 in Conditional Formatting.

    Or, if you used: =IF(COUNTIF($A$1:$E$5,A1)>1,"duplicate","") in a secondary matrix, you could filter on "duplicate" in either of the secondary matrix columns.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Countif across workbooks

    Maybe this is one way..But 1 million rows...

    In sheet1 B2 and copy down this.

    =(COUNTIF($A$1:$A$10000000,A1)+COUNTIF(Sheet2!$A$1:$A$10000000,A1))>1


    In sheet2 B2 and copy down this.

    =(COUNTIF($A$1:$A$10000000,A1)+COUNTIF(Sheet1!$A$1:$A$10000000,A1))>1
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    10-01-2010
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Countif across workbooks

    Huge thank you to both answers, I'm going to try them right away. I never thought of the two column solution

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Countif across workbooks

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Countif across workbooks

    .......................

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Countif across workbooks

    @vivekmartin: how went it?

    Regards, TMS

  8. #8
    Registered User
    Join Date
    10-01-2010
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Countif across workbooks

    Hi,

    Sorry I couldn't respond earlier. We found some discrepancies in the data and that is being cleaned up now. I'm intending to run the countif tonight. Will definitely post my feedback once done. Thank you.

  9. #9
    Registered User
    Join Date
    10-01-2010
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Countif across workbooks

    Hi,

    The countif worked perfect, just that it took a long long time to run for such huge data. But it did its job! Thank you!

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Countif across workbooks

    Glad we could help.

+ 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