+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    03-01-2010
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    2

    Cool Help cleaning up formula

    Hello all,

    I need some help cleaning up the formula below to reduce the amount of time it takes to compute. So far, the workbook takes about 5 minutes to go to the whole equation as I have it repeated about 1050 times in different cells.

    Perhaps a macro would expedite the calculations, but I have no knowledge of how to do one to reproduce what I want to do.

    Formula:

    =(SUM(('Raw Data 14-26'!$C$1:'Raw Data 14-26'!$C$64635='Raw Data 14-26'!$P$2)*('Raw Data 14-26'!$B$1:'Raw Data 14-26'!$B$64635=1)*(IF(ISTEXT('Raw Data 14-26'!$G$1:'Raw Data 14-26'!$G$64635),0,'Raw Data 14-26'!$G$1:'Raw Data 14-26'!$G$64635))))*-1

    I am simply doing a 3 array multiplication with ranges of 6 colums by 64635 rows and then adding the resulting array to come up with a value specific to a cell. The problem comes with the imported data as it has text and numbers and thus the use of the is text function and if statements. In a graphical example, this is what I want to do.

    {0 0 34}*{0 0 1}*{0 0 1}={0 0 34}=sum(0 0 43}=34 but in a much bigger array.

    I'm also using the following mode formula to automatically obtain some of the values that I'm looking in the previous formula.

    Mode formula:

    =IF(ISNA(MODE(IF(COUNTIF(P$1:P2,$C$47:$C$486)=0,$C$47:$C$486))),0,MODE(IF(COUNTIF(P$1:P2,$C$47:$C$48 6)=0,$C$47:$C$486)))

    I attached the workbook in case someone want to give it a stab. I thank in advance to anyone who could help me.
    Attached Files Attached Files
    Last edited by NBVC; 03-01-2010 at 04:57 PM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,132

    Re: Help cleaning up formula

    Those ranges are way too big... for all the formulas you are trying to calculate...
    You need to shorten the ranges... maybe make them dynamic...

    For example, in B1 of Points 1-13 sheet enter formula: =MATCH(9.9999999999E+307,'Raw Data 1-13'!B:B)

    That finds the last row in the Raw Data 1-13 sheet with a number in column B... assuming that the last row will have a number...

    then, say in F6 of Points 1-13 you can use formula like:

    Code:
    =-SUMPRODUCT(('Raw Data 1-13'!$C$1:INDEX('Raw Data 1-13'!$C:$C,$B$1)='Raw Data 1-13'!$P$3)*('Raw Data 1-13'!$B$1:INDEX('Raw Data 1-13'!$B:$B,$B$1)=COLUMNS($E$1:E$1))*(ISNUMBER('Raw Data 1-13'!$G$1:INDEX('Raw Data 1-13'!$G:$G,$B$1))),'Raw Data 1-13'!$G$1:INDEX('Raw Data 1-13'!$G:$G,$B$1))
    and copy it across the 9 columns.. note the COLUMNS($E$1:E$1) in the formula is what adjusts the number to compare too from 1 to 2 to 3 to 4, etc...

    You can use this same concept on the other tables/cells...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-01-2010
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Help cleaning up formula

    Wow, your formula is A LOT more cleaner! It reduced the computational time by 95%! Awesome! Thanks a lot!

Thread Information

Users Browsing this Thread

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

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.2.0