+ Reply to Thread
Results 1 to 5 of 5

How to dynamically set array size in sumproduct function.

  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    MS-Off Ver
    Excel 2003 and Excel 2016
    Posts
    178

    How to dynamically set array size in sumproduct function.

    Other than using the 'Indirect' function (or VBA), is there a way to get the row numbers of a named range of rows in an unopened workbook and use those row numbers in a formula in the active workbook? I'm using a 'sumproduct' (Excel 2003) function to count the number of cells in a range of rows in the unopened workbook that match the value in column 'A' of active workbook. Problem is that the range of rows in the unopened workbook changes. The 'sumproduct' works but only if the range of rows (the array) is fixed in size. In the following example, 'H$5002' has been arbitrarily set and is fixed. I want to be able to change that row number as rows are added to the unopened workbook range.

    For example:

    =SUMPRODUCT(1*('C:\Folder1\[UnopenedWB.xls]Sheet1'!H$7:H$5002=A1888))
    Thanks.

  2. #2
    Registered User
    Join Date
    04-10-2020
    Location
    Beirut, Lebanon
    MS-Off Ver
    Office 365
    Posts
    15

    Re: How to dynamically set array size in sumproduct function.

    Hello,

    you can use Format as Table tool

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: How to dynamically set array size in sumproduct function.

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your version.
    Thanks

  4. #4
    Forum Contributor
    Join Date
    07-16-2007
    MS-Off Ver
    Excel 2003 and Excel 2016
    Posts
    178

    Re: How to dynamically set array size in sumproduct function.

    Sorry, but how do you do that? Thanks.

  5. #5
    Registered User
    Join Date
    04-10-2020
    Location
    Beirut, Lebanon
    MS-Off Ver
    Office 365
    Posts
    15

    Re: How to dynamically set array size in sumproduct function.

    Select the table and add as much columns and rows as you need, then Home tab, then Format as Table, select any format

+ 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. Sumproduct with varying array size
    By scottyboy218 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2016, 11:44 AM
  2. Multiple size array sumproduct
    By scottyboy218 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2016, 10:35 AM
  3. Multiple size array sumproduct
    By scottyboy218 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2016, 10:16 AM
  4. Sumproduct with varying array size
    By scottyboy218 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2016, 10:15 AM
  5. Need to enlarge row size of array dynamically while preserving data in vba
    By min9ox2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2014, 01:47 AM
  6. Function To Dynamically Display File Size
    By MDW in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-16-2006, 05:50 PM
  7. [SOLVED] How to use function that returns array of variable size?
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2006, 04:45 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