+ Reply to Thread
Results 1 to 4 of 4

Formula too long

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    27

    Formula too long

    Hi all,

    Is there any way to make the forumla below shorter? Not only does it take a long time to calculate several variations at once, but some variations are too long to fit in.

    =SUMPRODUCT((LEFT(January!$K$2:$K$10000,2)="US")*(LEFT(January!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",January!$E$2:$E$10000))))
    +
    SUMPRODUCT((LEFT(February!$K$2:$K$10000,2)="US")*(LEFT(February!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",February!$E$2:$E$10000))))
    +
    SUMPRODUCT((LEFT(March!$K$2:$K$10000,2)="US")*(LEFT(March!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",March!$E$2:$E$10000))))
    +
    SUMPRODUCT((LEFT(April!$K$2:$K$10000,2)="US")*(LEFT(April!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",April!$E$2:$E$10000))))
    +
    SUMPRODUCT((LEFT(May!$K$2:$K$10000,2)="US")*(LEFT(May!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",May!$E$2:$E$10000))))
    +
    SUMPRODUCT((LEFT(June!$K$2:$K$10000,2)="US")*(LEFT(June!$M$2:$M$10000,LEN($C$3))=$C$3),--(ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",June!$E$2:$E$10000))))

    Up until now I've been splitting it up into two cells, but it still takes a very long time to calculate it all.

    This will be even more problematic should I need to add more months.

    Thanks!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula too long

    it might be better to add a helper column on each sheet =and(left(k2,2)="us",LEFT(M2,LEN($C$3))=$C$3,ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",$E$2) then countif(that column,true)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Formula too long

    Do you really need to scan through 10000 rows for each SUMPRODUCT? Keep the range to the number of rows with data. It will save calculation time
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    08-07-2012
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Formula too long

    Quote Originally Posted by martindwilson View Post
    it might be better to add a helper column on each sheet =and(left(k2,2)="us",LEFT(M2,LEN($C$3))=$C$3,ISNUMBER(SEARCH("MAT - INSUFFICIENT CP STOCK",$E$2) then countif(that column,true)
    I'll give it a go, unfortunately I'll have a lot of new columns for all the variations.

    Quote Originally Posted by Ace_XL View Post
    Do you really need to scan through 10000 rows for each SUMPRODUCT? Keep the range to the number of rows with data. It will save calculation time
    Yes, I have close to 10000 rows on every sheet

+ 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