+ Reply to Thread
Results 1 to 9 of 9

Saving file space by simplifying formulae

  1. #1
    Registered User
    Join Date
    03-19-2014
    Location
    Grayshott, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Saving file space by simplifying formulae

    Hi - I've built a spreadsheet tool to analyse a MS project plan to determine resource demands based on a RACI chart. The upshot is that I have multiple cells (thousands) with complex fomulae that a) take up a lot of space and b) take an age to process.
    The main formula is:
    =IF(AND((OR(AND(TEXT(AF$7,"yyyymmdd")>=TEXT($D1990,"yyyymmdd"),TEXT(AF$8,"yyyymmdd")>=TEXT($E1990,"yyyymmdd"),TEXT(AF$7,"yyyymmdd")<=TEXT($E1990,"yyyymmdd")),AND(TEXT(AF$7,"yyyymmdd")<=TEXT($D1990,"yyyymmdd"),TEXT(AF$8,"yyyymmdd")>=TEXT($E1990,"yyyymmdd")),AND(TEXT(AF$7,"yyyymmdd")<=TEXT($D1990,"yyyymmdd"),TEXT(AF$8,"yyyymmdd")<=TEXT($E1990,"yyyymmdd"),TEXT(AF$8,"yyyymmdd")>=TEXT($D1990,"yyyymmdd")),AND(TEXT(AF$7,"yyyymmdd")>=TEXT($D1990,"yyyymmdd"),TEXT(AF$8,"yyyymmdd")<=TEXT($E1990,"yyyymmdd"))))),(7.2* (NETWORKDAYS(HLOOKUP(CONCATENATE(AF$7,"S"),$H$9:$AE$1980,$G1990,FALSE),HLOOKUP(CONCATENATE(AF$7,"E"),$H$9:$AE$1980,$G1990,FALSE)))*VLOOKUP(VLOOKUP($F1990,Lookups!$G:$AE,AF$9,FALSE),Lookups!$A:$B,2,FALSE)),"").

    Essentially this calculates the actual effort in hours between start-end dates, driven by a RACI (responsible, accountable, consulted, informed) value that indicates the percentage effort applied to the given task, e.g. Accountable 20% effort, Responsible, 80%. Calculated hours are stored in a large matrix of role and time against project task, for later summary.

    Two questions: 1) can I simplify the formula and/or 2) can I somehow store it once and somehow parameterise it/call it as a subroutine? I'm guessing both options would save space and maybe processing time. Any thoughts welcome.
    Thanks,
    Graham

  2. #2
    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,519

    Re: Saving file space by simplifying formulae

    Can I ask why you are converting all the dates to text before comparing them? Seems an unnecessary and labour intensive task given that you can compare dates as numbers.

    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


  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Saving file space by simplifying formulae

    I'm not sure why you are converting all those dates to text values and then comparing them - can't you just compare them directly, so the first line of your monster formula would become:

    =IF(AND((OR(AND(AF$7>=$D1990,AF$8>=$E1990,AF$7<=$E1990),AND( ....

    much shorter already !!

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    03-19-2014
    Location
    Grayshott, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Saving file space by simplifying formulae

    Thanks Pete. Someone else asked the same question. It's because tasks can straddle start and end dates of the pigeon holes I accumulate the values in. I'm sure I've missed something, but I think the sequencing of unpicking years, months and dates is important and I couldn't figure a better way.
    Graham

  5. #5
    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,519

    Re: Saving file space by simplifying formulae

    They're dates. Converting them to text and comparing them won't make them any different. Just puts a lot of effort into converting them and then doing a text comparison.

  6. #6
    Registered User
    Join Date
    03-19-2014
    Location
    Grayshott, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Saving file space by simplifying formulae

    ok - let me think about that. Maybe I've over-complicated things.

  7. #7
    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,519

    Re: Saving file space by simplifying formulae

    I think you're outvoted on the "maybe"

  8. #8
    Registered User
    Join Date
    03-19-2014
    Location
    Grayshott, UK
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Saving file space by simplifying formulae

    Gotcha!

  9. #9
    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,519

    Re: Saving file space by simplifying formulae

    This formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    ... is roughly half the length of the original formula, give or take. A little easier to read, and it doesn't have the overhead of converting 20 dates to text before trying to do a text comparison.

    And, where you use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    you could replace that with
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Small saving, but ...

    I would have though it would be quicker ... no promises though. Especially, if you have hundreds or thousands of them.

    Regards, TMS



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
    Last edited by TMS; 03-19-2014 at 09:51 AM.

+ 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. Saving spreadsheet as space delimited text file
    By glanglois822 in forum Excel General
    Replies: 3
    Last Post: 01-13-2013, 09:11 PM
  2. [SOLVED] Macro to free drive space before saving
    By pedrofogao21 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-25-2012, 12:17 PM
  3. Replies: 4
    Last Post: 02-07-2011, 11:59 AM
  4. Replies: 1
    Last Post: 01-05-2010, 08:03 AM
  5. Saving space in Array formula Sum(If(())...
    By Caro-Kann Defence in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2005, 04:06 PM

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