+ Reply to Thread
Results 1 to 7 of 7

Formula? Or Macro? Which is faster?

  1. #1
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Formula? Or Macro? Which is faster?

    I have a problem in that i perform lots of analysis using formula. In an attempt to speed the sheet up i have copied these formula to a control sheet from which i re put them into my master sheet and then replace as values. The problem is that this workbook is rather huge and has become very slow rather quickly.

    Example formula are ;listed below. I was wondering what would be the most robust method of performing this analysis. Via macro? or a different way of writing my formula?

    e.g.

    =IF(AND(ISNUMBER(TC9),(ISNUMBER(TD9))),(TD9-TC9),(""))

    =IF(AND(ISNUMBER($R22),(ISNUMBER($AI22))),($AI22),IF(ISNUMBER($R22),(0),("")))

    =IF(AND(ISNUMBER(R9),(RA9>=100)),($RH$27),IF(AND(ISNUMBER(R9),(ISNUMBER(RA9))),($RL$31*(EXP($RK$31*RA9))),("")))


    Any comments,/help/examples would be appreciated.

    Alan

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Formula? Or Macro? Which is faster?

    Hi,

    I don't think the formula that you've posted are very calculation intensive so I'd be surprised if they were causing a bottleneck in your worksheet. What other calculations do you have going on and over what sort of range of data?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Contributor
    Join Date
    12-01-2010
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    303

    Re: Formula? Or Macro? Which is faster?

    i have loads of similar formula, all referencing each other. There is simply alot of them, i cannot provide example sheet data is confidential. :s

    ?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formula? Or Macro? Which is faster?

    Your formulae also have some unnecessary parenthesis

    fi (T9-C9), ("") etc...

    Don't think that slows things down though

    Also, do you have any volatile functions in your wbooks? ( TODAY, NOW, INDIRECT, etc...) ?

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Formula? Or Macro? Which is faster?

    You could use something like this, just put the formulas in the Cells you need. Use the macro to do the calculations for you and then just leave the values in the the cells.

    Just a thought.
    Please Login or Register  to view this content.
    Edit: Authur made a good point about if you have any volatile functions in your workbook, as they would be converted to values too.
    Last edited by JapanDave; 11-15-2011 at 09:27 AM.

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Formula? Or Macro? Which is faster?

    @JapanDave

    For info the use of AutoFill is unnecessary:

    Please Login or Register  to view this content.

    Dom

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Formula? Or Macro? Which is faster?

    Domski, thanks for the tip. I have been trying to figure that one out for a while now.

+ 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