+ Reply to Thread
Results 1 to 18 of 18

Sumproduct cell range grows and calculation takes too long

  1. #1
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Sumproduct cell range grows and calculation takes too long

    I have this Sumproduct formula below

    =SUMPRODUCT(--(TEXT(AccompReport!$B$2:$B$10000,"mmm")=C$1),--(AccompReport!$F$2:$F$10000="Juan Dela Cruz")*(AccompReport!$E$2:$E$10000))

    =SUMPRODUCT(--(AccompReport!$C$2:$C$10000="Assistance"),--(TEXT(AccompReport!$B$2:$B$10000,"mmm")=B$1))


    that set's to this "$B$2:$B$10000" range but my records can reach beyond this range, it's more than 10,000 rows... the problem is, from this formula it took long time to calculate those... any one can help me on how to make the cell range auto adjusted?... or any way to make the caculation fast... I'm using a VBA Userform for encoding... i include "Application.Calculation = xlCalculationManual" and "Application.Calculation = xlCalculationAutomatic"... it makes a little help but still needs to wait from calculation... any help?...
    Last edited by rhonalddean; 11-18-2012 at 02:55 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    Hi rhonalddean,

    You can use defined names which will automatically include the increasing / decreasing ranges.. press ctrl + F3 to open name manager and use the logic as ... =offset($B$2,0,0,counta($b:$b)-1,1)... adjust it accordingly as per you actual data spread as I have written as a guess

    In case of any issues, upload a sample workbook.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    I found one like this from "name manager" =OFFSET(AccompReport!$F$2,0,0,COUNTA(AccompReport!$F:$F),1) and it's working... what about your code "=offset($B$2,0,0,counta($b:$b)-1,1)" with "-1" what's the difference?... Thanks for the reply...


    Edit: Great! i understand what "-1" does... much better... problem solved!

    BTW the auto calculation works much faster now...
    Last edited by rhonalddean; 11-18-2012 at 02:55 AM.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    As I said that was just a formula based on my guess.. I introduced -1 there just to remove the header row

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Forum Contributor
    Join Date
    12-23-2007
    Location
    chennai india
    MS-Off Ver
    2010
    Posts
    141

    Re: Sumproduct cell range grows and calculation takes too long

    Dear Dilip Pandey

    If middle rows are blank it will not work proper. If b10 to b17 are blank then it will deduct 7 cells from bottom.

    Regards

    J P Bisani

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    I agree.. this issue is there with all the defined names and that's why you need to use the count / counta on the column which will not have any blank entries

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    I agree.. this issue is there with all the defined names and that's why you need to use the count / counta on the column which will not have any blank entries

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    Here is a solution for this blanks issue :-

    See attached file and use the dynamic defined name "data".. thanks.
    dynamic name to handle blanks.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  9. #9
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    i have attached my work... hope to analyze it. working fine on my computer but when i deploy it to other computer the calculations become really slow and sometimes turns the file not to respond...

    hope you can help... other thread says "Sumifs" is faster than "sumproduct" but i don't understand how to do it... "sumifs" a lot different...


    Accomplishment & LED Movie Report Template.xlsm

    Thanks!

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    Ok.. where to look into the attachment.. i.e, which sheet / row /column / cell ? Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  11. #11
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    The formula is on the 1st and second sheets... the other sheets is for data encoding... i used VBA for it...

  12. #12
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    add to it... i'm using COUNTA to count the filled cells (cells with text), but it also count the cells with formula. how to count the filled cells that can ignore the cells with formula?...

  13. #13
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    how to count the filled cells that can ignore the cells with formula?...
    Excel 2013 has ISFORMULA function which can check if a cell has formula or not ..
    Alternatively, you can use Len function to check if a cell has formula returning blank, it will always return 0 OR there are other ways which can be used. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  14. #14
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    Thanks for the reply... is there any sample code on counting filled cells with ignoring formulated cells?...

    Would you mind to ask how's my work attachment?... any suggestion?... why is it too slow on other computer after deployment?... the other computer is much higher specification than mine, is there any missing files or configuration on excel to change?...

  15. #15
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    Thanks for the reply... is there any sample code on counting filled cells with ignoring formulated cells?...

    Would you mind to ask how's my work attachment?... any suggestion?... why is it too slow on other computer after deployment?... the other computer is much higher specification than mine, is there any missing files or configuration on excel to change?...

  16. #16
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    Yes. there is a way to ignore the formulated cells. I had already replied about that in my post #8. There is an attachment as well. Please look into that.

    Suggestion:- As per me, there is not much considerable difference between SumIF and SumProduct.. though SumIF is faster but calculation speed also depends on your system configuration

    Idea:- Turn off the auto calculation and press Shift + F9 which will calculate current worksheet only

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  17. #17
    Registered User
    Join Date
    09-05-2011
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Sumproduct cell range grows and calculation takes too long

    Thanks for the support. Any sample vba code for Shift+F9 in a push of a button?...

  18. #18
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sumproduct cell range grows and calculation takes too long

    Shift + F9 is itself a "push of button(s)"

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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