+ Reply to Thread
Results 1 to 5 of 5

can shorten this formula?

  1. #1
    Forum Contributor
    Join Date
    07-24-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2010 (office) 2013 (home)
    Posts
    256

    can shorten this formula?

    Hi,

    In my worksheet, i have formulae as follow:

    IF(I$5="actual",IF(ISERROR(VLOOKUP($A17,'[worksheet1.xls]fun'!$A:$AO,I$3,FALSE)),0,VLOOKUP($A17,'[worksheet1.xls]fun'!$A:$AO,I$3,FALSE)),0)

    FYI, I$3 is a blank cell.

    As there are so many helpful experts on this forum, i would like to know is it possible to shorten this formula?

    Thanks
    Last edited by mingali; 08-12-2009 at 06:21 AM. Reason: spelling mistake

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: can shorten this formula?

    If the source file is not always open certain formulae are not viable, specifically SUMIF - I say SUMIF because if A17 appears only once in Col A of the other file and the value being returned from the matrix is numeric you could use SUMIF which would by default return 0 if there were no match, eg:

    Please Login or Register  to view this content.
    If the value is always numeric you could use:

    Please Login or Register  to view this content.
    which though not shorter in length does not evaluate the VLOOKUP twice.

    (I'm assuming you're generating some sort of matrix with codes on left and months across the top)

  3. #3
    Forum Contributor
    Join Date
    07-24-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2010 (office) 2013 (home)
    Posts
    256

    Re: can shorten this formula?

    Hi DonkeyOte,

    Your assumption is correct. However, may i know which formula take up less memory to run? my firm has too many excel files with formula and linking and it takes up a lot of RAM and slow to open. Some files are so large that it takes a few minutes to open, especially when source files require to be opened also.

    Thanks

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: can shorten this formula?

    you might want to change those whole range references
    $A:$AO, to a reasonable limit
    say A1:AO1000
    or somwhere around the max data is likely to be
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: can shorten this formula?

    Quote Originally Posted by mingali View Post
    Hi DonkeyOte,

    Your assumption is correct. However, may i know which formula take up less memory to run? my firm has too many excel files with formula and linking and it takes up a lot of RAM and slow to open. Some files are so large that it takes a few minutes to open, especially when source files require to be opened also.

    Thanks
    If the Workbooks are closed then I would presume the LOOKUP based approach would perform better than the double evaluation method, that said I don't have the requisite knowledge to state that with any real conviction.

    As a general rule (and as impractical as it may sound) I have always gone to great lengths so as to avoid linking files as the process was far too "fragile" for my liking, not to mention the issues that arise if you travel around to any great extent
    ie having perm links to files in the UK when travelling in the US is not very practical!

    A central repository is nearly always the best approach be it a purpose built database like SQLSvr, MySQL etc or even an XL file ... essentially trying to retrieve info link-less into the file in which the calculations are to be performed

    There are a few people out there who regularly use ADO to retrieve info from closed XL files, see for ex: http://www.rondebruin.nl/ado.htm

+ 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