+ Reply to Thread
Results 1 to 9 of 9

How to reduce WS size by modifying an equation used more than73,000 times in WS

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Philly
    MS-Off Ver
    Excel 2010
    Posts
    26

    How to reduce WS size by modifying an equation used more than73,000 times in WS

    I have a WS that has daily prices on for over 7 years. In another WS I need to calculate the daily rate of change for the ratio of each item to each other. Example: Items a,b,c,d,e,f...
    Step 1. calculate the ratios of: price a/price b, price a/ price c, price a/price d... price f/ price d... price j/price i.
    step 2. calculate the daily rate of change for each ratio found from step 1.

    Below is what I've used to calculate the price relative to each other
    =INDEX('Prices-M'!$A$1:$Q$1913,MATCH($G2,'Prices-M'!$A$1:$A$1913,0),MATCH($A$2,'Prices-M'!$A$1:$P$1,0))/INDEX('Prices-M'!$A$1:$Q$1913,MATCH($G2,'Prices-M'!$A$1:$A$1913,0),MATCH($A$8,'Prices-M'!$A$1:$P$1,0)

    On the Prices-M WS Column A has the date sorted from oldest to newest and row A is a header with A1-P1 having each item name in it. Beneath each item name is the price on the day corresponding to the date on that row in column A.

    On the current worksheet column G has the same dates sorted oldest to newest and row A is a column header with a description of each ratio. Beneath description is the ratio on the day corresponding to the date on that row in column A based on the description.

    Please Login or Register  to view this content.
    The daily percentage change of the ratios is calculated as
    Please Login or Register  to view this content.
    dragged down and across the matrix.

    The workbook is now 11 MB as there are other pages with formulas. Any ideas on how to reduce the size and increase the speed of this code?
    Thanks,
    Doug
    Last edited by uptickdk; 08-29-2014 at 02:43 AM.

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    Hi,

    I guess following steps can help you to reduce the WB size and increase the preformance.

    1) Clean Up the Workbook: If there are any Used ranges in the workbook then DELETE it.
    2) Dont use Preformatted excel. Only format the number of rows which are required to be formatted and style.
    3) Delete the unused formulas and references.
    4) Avoid Volatile functions and set calculation of formula to Manual rather than Automatic.
    5) Try to delete the data if not required


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    To add to what Paresh has said, I assume that the majority of the data is historic. Consequently, having calculated the values, you can Copy the data and Paste Special | Values to remove much of the calculation overhead.

    I'd suggest that you leave maybe a week's worth of formula in case the data changes.

    Together with removing blank and/or pre-prepared rows, formatting and Conditional Formatting, it should reduce the size of the workbook significantly.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    04-25-2013
    Location
    Philly
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    Thank you for the suggestions. I do copy and special paste values into another worksheet. Any thoughts on the formula and how to re-wright it in a way to reduce size? I want to worksheet to automatically keep going w/o me haveing to specail past.
    Thanks,
    Doug

  5. #5
    Registered User
    Join Date
    07-30-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    One way I've found to reduce workbook size is to save it as an .xlsb. I'm willing to bet you are not using any internet procedures that the binary file would preclude, but it will net you significant savings in size. I've cut file sizes in half by doing this by itself.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    You use this twice in the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    So, if you added a Helper column and put
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in it and copied it down, that would save some calculations. Or you could maybe put that formula in a Named Range and refer to it. That would save creating and managing the Helper Column.

    And it may be worth looking at the MATCH for the column and seeing if there is a fixed relationship. In other words, can you do that calculation once and adjust it by adding a fixed amount to it.

    Bit in the dark really because I can't visualise your data.

    Regards, TMS

  7. #7
    Registered User
    Join Date
    04-25-2013
    Location
    Philly
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    Saved as .xlb, it saved 2MB, thanks for the idea. Regarding TMS's idea of a helper column, the table has 42 columns and 1913 rows of data so that's a lot of helper columns. Was wondering if there was some sort of sumproduct or other function that would let me combine the division work of the first formula with the daily percentage change formula (2nd formula).

    Below is a sample of what this table looks like, I can't upload due to size.

    date item A item b item c item d ... item ar
    12/31/06 0.007 0.0136 0.021 0.023 0.xx
    1/1/07 0.007 0.0163 0.021 0.022 0.xx
    1/2/07 0.007 0.0152 0.022 0.022 0.xx
    1/3/07 0.0071 0.0166 0.024 0.024 0.xx
    .
    .
    .
    8/1/14

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    The column reference $G in the cell reference $G2 is absolute as are the lookup references. Presumably, that is to allow the formula to be dragged across. On that basis, you would only need one helper column to cater for that part of the formula.

    But, you're looking for suggestions. That was a suggestion. Do with it what you will.

  9. #9
    Registered User
    Join Date
    04-25-2013
    Location
    Philly
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: How to reduce WS size by modifying an equation used more than73,000 times in WS

    thank you for the helper column. I misunderstood hoe to use it but am now.

+ 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. Replies: 9
    Last Post: 05-18-2023, 07:18 PM
  2. Spreadsheet size is too large - any tips to reduce the size?
    By Jessica.Bush in forum Excel General
    Replies: 9
    Last Post: 11-11-2015, 02:45 PM
  3. Need to reduce file size
    By cuznleroy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2014, 12:24 PM
  4. Replies: 1
    Last Post: 12-17-2013, 03:18 PM
  5. How to reduce File Size
    By santoshsapre in forum Excel General
    Replies: 3
    Last Post: 06-25-2012, 09:06 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