+ Reply to Thread
Results 1 to 8 of 8

Poll on - Lots of simple formulas vs fewer but more complex formulas

  1. #1
    Forum Contributor
    Join Date
    05-27-2014
    Posts
    141

    Poll on - Lots of simple formulas vs fewer but more complex formulas

    Hi All,

    I would like peoples opinions, I have a fairly complex spreadsheet and views on which is better from a performance point of view

    The spreadsheet has approx 5000 formulas of which 3000-4000 are basic ifs & vlookup and that kind of level, would it speed up performance if the total formulas were reduced by replacing them with fewer more complicated formulas.

    Or does this even matter?

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    Some valuable reading here: http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    using of volatile functions are more impotant for perfomance

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    It is an interesting question. A few of my thoughts:

    1) All else being equal (same number of total operations, etc.), I expect that the difference in computation time between having the calculation spread over several cells vs. being crammed into megaformulas is probably small. I am reminded of this xkcd comic: http://xkcd.com/1445/ All else being equal, I expect one will spend a lot more time deciding which approach is more efficient than will ever be recovered.

    Along these same lines, I am reminded of a comment my mentor put into one of his code blocks. In commenting on why he chose a certain approach, he said that he recognized that this approach can slow the program down, but he felt that it was easier for the programmer to code, debug, and change. Easier to code and debug made the code more reliable/accurate, and made it faster and easier to code and change. In other words, he was willing to make the computer work harder so that it was easier for him. In this respect, since I find it easier to code multiple simple formulas into multiple cells than to try and code and debug a single megaformula, I prefer to break my computations up into multiple steps.

    2) Of course, everything is not always equal. I have often noticed something that Olly's link points out. When we use "megaformulas" and array formulas, we increase the possibility of "duplicated effort" -- each copy of a megaformula ends up repeating the same "lookup" or other computation over and over. I recall a discussion here between another user and me (I think it has been lost in a crash) where he compared a few different mega - array formulas performance over a large database. I recognized the duplicated effort in his formulas, and pulled that part out into a helper column. Doing so reduced what was a 30-40 second computation down to 1-2 seconds. IMO, smaller formulas make it easier to recognize and separate out duplicated effort, and thus improve spreadsheet performance.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Contributor
    Join Date
    05-27-2014
    Posts
    141

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    Thanks for that, It all makes for some interesting reads and thoughts. my spreadsheet has had alot of input from here in resolving certain issues. I think it all depends on the persons knowledge as well because when I first started this spreadsheet people told me it had to be a VBA control, someone had their input and made it work through several array's. one month later I asked if anybody knew how to improve performance/accuracy and hey did.

    it is most certainly fun

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    There is calculation timer code at this link:

    http://msdn.microsoft.com/en-us/library/aa730921.aspx

    You can run some tests and see for yourself which is faster.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    I've seen mega-formulas posted here that wrap to five..six.. lines. What happens when it's been a year since you've seen it and now have to modify it for some reason? You may also move on to greener pastures leaving mega-forumulas to some one who is seeing them for the first time, and some one wants mods now...
    Ben Van Johnson

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Poll on - Lots of simple formulas vs fewer but more complex formulas

    I have always taken the approach, that where possbble/practical, I try and use a few smaller formulas, rather than 1 huge, impressive-looking formula. Small formulas are far easier to edit/adjust/understand, and more importantly, trouble-shoot.

    If this might result in a slight performance loss, then maybe that is something to consider
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 2
    Last Post: 10-13-2014, 01:02 PM
  2. Lots of formulas....Slow Calculations
    By Zipmeister in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2012, 06:42 AM
  3. Complex Formulas and If Formulas
    By Nuclearman83 in forum Excel General
    Replies: 9
    Last Post: 03-14-2012, 02:10 PM
  4. Applying formulas to lots of data
    By Trothwell in forum Excel General
    Replies: 5
    Last Post: 07-20-2009, 08:56 AM
  5. [SOLVED] How do I speed up recalcs when using lots of SUMPRODUCT formulas
    By Peterdout in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-12-2006, 10:20 PM

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