+ Reply to Thread
Results 1 to 4 of 4

Equivalent of worksheetfunction.sumif for an array

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Equivalent of worksheetfunction.sumif for an array

    Hello,
    I have 2 arrays.
    1st array (POlist) is a list of PO numbers, which can change.
    2nd array (InvoiceAmounts) is a list consisting of a PO (Column A) & corresponding invoice amounts (Column B) as shown below.

    PO Invoice
    1 234
    2 856.5
    5 655.51
    1 5656.6
    2 1565.54
    1 130
    5 98.57

    So PO 1 would be 6,020.60
    PO 2 would be 2,422.04
    etc

    I would like to find an efficient way sum all the $ amounts per PO in POlist. I would prefer to avoid looping though the invoice amounts numerous times if possible.
    I tried to use worksheetfunction.sumif, but after some research, I found out that this will not work since an array is not a range.

    Any ideas would be greatly appreciated.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Equivalent of worksheetfunction.sumif for an array

    post the workbook with the vb code you are using
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: Equivalent of worksheetfunction.sumif for an array

    Quote Originally Posted by protonLeah View Post
    post the workbook with the vb code you are using
    Example_SumifArray.xlsm

    Hi ProtonLeh, Please see the attached.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Equivalent of worksheetfunction.sumif for an array

    An alternative to the macro is a pivot table or a formula on the same tab or different one:
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] SumIf WorksheetFunction referencing another workbook
    By eric_deltour in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2013, 07:22 PM
  2. SumIf WorksheetFunction referencing another workbook
    By eric_deltour in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2013, 11:58 PM
  3. [SOLVED] Error Using WorksheetFunction.SumIf
    By unvme1212 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2013, 01:52 PM
  4. vba and conditional totalling ... WorksheetFunction SumIf ?
    By SA3214 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-29-2005, 03:05 PM
  5. SUMIF equivalent used over 3-D range?
    By MickyD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-13-2005, 08:34 PM

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