+ Reply to Thread
Results 1 to 6 of 6

Converting countif into array to work on closed books

  1. #1
    Registered User
    Join Date
    06-06-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    13

    Converting countif into array to work on closed books

    Hi everyone,

    I have a formula which worked flawlessly until I tried to use it with the source material closed. I now know that excel returns value errors when a countif references a closed book. The advice I received to work around this is to change the formula from countif(FORMULA) to a version of sum(if(formula=criteria,1,0) except I can't seem to get that to work.

    My original formula is posted below, any help is greatly appreciated.

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


    Intent is to find if a figure (in this case the text value in L26) is contained in a range on another sheet. If it is in the first range, call it equity, the second range, call it fixed income, and in none, call it non classified.

    Thank you!

  2. #2
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Converting countif into array to work on closed books

    Hey scohn14, I seem to recall that the only way you can interact with a closed Excel file is to use a link.

    The formula would look a bit different because it references the file a little differerntly. For example,

    Please Login or Register  to view this content.
    I just tried the above on a closed worksheet and it works for me. You might try your formula using the linking method. Caveat: I have not tried it with a more complicated formula. Suggest in building the formula that you have the other files open and point to those files as part of typing the formula; that causes the linkage.

    Hope this helps.

  3. #3
    Registered User
    Join Date
    06-06-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Converting countif into array to work on closed books

    Hi snapfade,

    Thank you for the quick response. Unfortunately this did not correct the errors I am encountering.

    My issue seems to stem from the use specifically of countif referencing the closed workbook. It persists even if I link directly to the file with the full path.

    As a note, the original pathing I listed in my formula above was created by having both books open and clicking the desired destination to let excel name things accordingly. Also, I have other formulas referencing the same book that work while it is closed.

    Thanks in advance to anyone else with any suggestions!

  4. #4
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Converting countif into array to work on closed books

    I can't make it work either, scohn14. I wonder if you could embed the countif in each of the files you are trying to reference. then you would simply refer to the cell of the closed files. Just a thought.

    good luck!

  5. #5
    Registered User
    Join Date
    06-06-2014
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Converting countif into array to work on closed books

    Thank you again for another good idea snapfade. Sadly, the countif is dynamic to each open sheet (one per portfolio), imbedding it in the closed sheet doesn't work either. It creates the same problem in reverse.

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Converting countif into array to work on closed books

    Try using SUMPRODUCT in place of COUNTIF.

    SUMPRODUCT works on closed workbooks.

+ 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. Importing data from closed work books in different locations and dynamic dates
    By pcevo53 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2013, 12:22 AM
  2. Macro to collate data from different work books and different work sheets
    By bvdileep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2012, 05:34 AM
  3. using a macro to import data from closed work books (various)
    By madbrit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-09-2012, 02:52 AM
  4. Referencing External Closed workbook Syntax (Books)?
    By danny2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2009, 01:55 AM
  5. Converting all my old excel books into 2007 in one shot
    By mbqc in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-01-2008, 01:04 PM
  6. Replies: 0
    Last Post: 12-19-2005, 07:45 PM
  7. [SOLVED] Countif in multiple books
    By Gareth in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-29-2005, 11:06 AM
  8. Replies: 2
    Last Post: 02-06-2005, 06:06 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