+ Reply to Thread
Results 1 to 5 of 5

sumifs vs. Application.WorksheetFunction.SumIfs

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    sumifs vs. Application.WorksheetFunction.SumIfs

    Hello,

    I have a data in 2 worksheets.
    “Start” and “Import”

    I have created a macro to replace the formula which was dragged in 20 rows



    =(SUMIFS(Import!$H$3:$H$1000000;Import!$G$3:$G$1000000;">+" &B26;Import!$G$3:$G$1000000;"<=" & C26))


    Macro is as follow.




    Please Login or Register  to view this content.
    When I have compared results between the formula and sumifs I have not get exactly the same results.

    For example formula adds number and gives me number: 25, where the macro calculates 22.

    Have I made a mistake somewhere in my macro?

    flooyd

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: sumifs vs. Application.WorksheetFunction.SumIfs

    Hi,

    Can you provide a sample workbook please?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: sumifs vs. Application.WorksheetFunction.SumIfs

    Hi,

    I have attached file to this post.

    As you will see the difference is tiny (just 3 seconds) but if I use a file with significantly bigger number of data the difference is more than few minutes.

    flooyd
    Attached Files Attached Files
    Last edited by flooyd; 09-01-2016 at 10:06 AM.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: sumifs vs. Application.WorksheetFunction.SumIfs

    I had presumed- apparently erroneously- that the >+ in your formula should have been >= as you use in the code. The actual calculations currently are not the same.

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    17

    Re: sumifs vs. Application.WorksheetFunction.SumIfs

    Hello,

    it was a basic mistake. Thank you for pointing it out.

    I have additional question. Is there a limitation for the sumifs macro?

    I have corrected macro for example 3. I have noticed that if the difference (or the range between) is very small (in my example 0.2, formula calculates 1 second, where macro calculates 0.

    Any idea why is that?
    flooyd
    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] Application.SumIfs help please
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2016, 12:06 PM
  2. [SOLVED] WorksheetFunction SumIfs With Multiple Criteria
    By Harry Basra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2016, 08:32 AM
  3. [SOLVED] WorksheetFunction.SumIfs + Variable
    By VitoBdG in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2016, 10:21 AM
  4. [SOLVED] Application.worksheetfunction.sumifs on large dataset
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2013, 08:22 PM
  5. How to use > in WorksheetFunction.Sumifs
    By davidman1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2013, 10:40 AM
  6. SUMIFS Puzzle - Trying to avoid adding multiple SUMIFS to get valid result
    By haldavid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-09-2013, 03:42 PM
  7. [SOLVED] Code optimization - WorksheetFunction.SumIfs() function
    By nfuids in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2012, 10:50 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