+ Reply to Thread
Results 1 to 4 of 4

How can I efficiently copy/edit COUNTIFS formulas that must reference new files daily

  1. #1
    Registered User
    Join Date
    09-26-2015
    Location
    Miami
    MS-Off Ver
    2013
    Posts
    1

    Question How can I efficiently copy/edit COUNTIFS formulas that must reference new files daily

    I have created a countifs formula that is looking up data from another work book. This is my first time using this particular function.

    I am creating a Yearly work book that will need to have this formula in 365 separate rows, however, everyday new updated data gets dropped in a specific location and is named for that day so I need to have unique references in each formula. (I.E. tomorrow the data needed will be in workbook named 9-26-2015.xlsx). I am hoping there is an efficient way to do this.

    I tried pulling the formula down and that did not work. Is there a less tedious way to do this other than doing it one by one? Also, not to complicate it anymore, but I need the cell in criteria 1 (BJ280) to go to (BJ281) when I copy down the data , while the cell in criteria # 2 (BW2) needs to remain as it is.

    Formula

    starting
    =COUNTIFS('[9-25-2015.xlsx]9-25-2015'!$D:$D,BJ280,'[9-25-2015.xlsx]9-25-2015'!$V:$V,BW2)

    need to reference a daily file drop so next formula should look like this and so on through9/2016:

    =COUNTIFS('[9-26-2015.xlsx]9-26-2015'!$D:$D,BJ281,'[9-26-2015.xlsx]9-26-2015'!$V:$V,BW2)


    Appreciate whatever feedback can be offered.
    Last edited by mbarnes79; 09-26-2015 at 01:40 PM. Reason: Update to title to put it in question form

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: How can I efficiently copy/edit COUNTIFS formulas that must reference new files daily

    Doesn't sound like a particularly efficient way of storing data, but if that's the way it's done then so be it.

    Difficult to provide a tailor made solution without seeing workbooks and having an idea of drive structure, but look into the use of =INDIRECT()

    Be warned, it's a volatile function and therefore can be quite demanding on processing power.

    BSB.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How can I efficiently copy/edit COUNTIFS formulas that must reference new files daily

    Also, if you use INDIRECT then the workbook(s) holding the source data have to be open for the formula to calculate.

    Without using INDIRECT you can make a formula work with a bit of trickery.

    First enter this formula, then copy it down for as many rows as you need.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will generate all of the required formula as text strings.

    Next copy the entire formula range and pastespecial - values to change them to real formula.
    Last edited by jason.b75; 09-26-2015 at 03:14 PM.

  4. #4
    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,929

    Re: How can I efficiently copy/edit COUNTIFS formulas that must reference new files daily

    Hi, welcome to the forum

    INDIRECT will not work on closed workbooks (as jason said), but you could take a look at installing the MoreFunc add-in that lets you access closed workbooks. It can be found here...
    http://www.ashishmathur.com/tag/morefunc/
    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

+ 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. Macro to run formulas more efficiently
    By Ale84 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-16-2015, 06:55 PM
  2. Copy, edit and save workbook to same location as source data file, not macro file.
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 09:01 AM
  3. Edit filename in Formula with reference to a cell in current file
    By yatin1964 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2013, 09:35 AM
  4. Copy row of data from daily csv to Master file
    By lindomsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 04:42 AM
  5. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  6. Simple Edit for Multiple File Reference?
    By perfectview in forum Excel General
    Replies: 1
    Last Post: 06-03-2009, 10:57 PM
  7. Copy cells from a excel file that filename changes daily.
    By gumby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2006, 11:30 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