+ Reply to Thread
Results 1 to 4 of 4

Shorten formula

Hybrid View

  1. #1
    Registered User
    Join Date
    12-26-2006
    Posts
    36

    Shorten formula

    Kind of new to excel - can someone help by shortening this formula:

    =[Invoices.xls]PR1!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR2'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR3'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR4'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR5'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR6'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR7'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR8'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR9'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR10'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR11'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR12'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR13'!$L$51+'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR14'!$L$51

    Thanks in advance!

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Shorten formula

    I don't think it is at all possible. Your formula refers to cells in other workbooks and it have to specify the full path to find the files it refers to. one way to reduce this formula is to change the path to find the files. Less sub-directories; shorter names; etc.
    Another possibility would be to condense all those files in a big one with multiple sheets.
    Good luck

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Shorten formula

    If the file H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]

    is in the same directory replace

    H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]

    by

    [Invoices.xls]

    Otherwise in this file H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]
    open new sheet PR15. In that Sheet PR15 put the formula in L51 cell

    =PR1!$L$51+PR2!$L$51+.......+PR14!$L$51

    The present formula replace with
    'H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR15'!$L$51

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Shorten formula

    use named ranges; e.g.

    PR1:
    ='H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR1'!$L$51

    PR2:
    ='H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR2'!$L$51

    PR3:
    ='H:\Year 2011\NPM CONST\Blank\Pay Requests\[Invoices.xls]PR3'!$L$51


    In the formula you can use
    PHP Code: 
    =PR1+PR2+PR3 
    Or you can change the workbookproperty 'hyperlinkbase' into H:\Year 2011\NPM CONST\Blank\Pay Requests\

    now in the formula you only have to enter
    PHP Code: 
    [Invoices.xls]PR3'!$L$51 +[Invoices.xls]PR4'!$L$51 
    Last edited by snb; 09-12-2011 at 08:46 AM.



+ 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