+ Reply to Thread
Results 1 to 3 of 3

reducing formula size

  1. #1
    Registered User
    Join Date
    07-30-2007
    Posts
    12

    reducing formula size

    Hi,
    I have a formula that looks at another file to get a number of things. The only problem is that the formula is now over 255 characters, so I cannot update the filename link as the formula is too long. Is it possible to either:
    1. pass the filename as a variable name (to reduce the formula length)
    2. Write this formula in a shorter way (in not adept at VBA yet).

    The formula is:

    =IF(ISNA(INDEX('P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$1:$65536,MATCH($G8,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$A:$A,0),MATCH(Q$6,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$4:$4,0),1)),0,INDEX('P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$1:$65536,MATCH($G8,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$A:$A,0),MATCH(Q$6,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$4:$4,0),1))+IF(ISNA(INDEX('P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$1:$65536,MATCH($G8,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$A:$A,0),MATCH(Q$6,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$5:$5,0),1)),0,INDEX('P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$1:$65536,MATCH($G8,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$A:$A,0),MATCH(Q$6,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$5:$5,0),1))/(52/12)

    or if you want to make some sense out of it:

    =IF(ISNA(
    INDEX(
    'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$1:$65536,MATCH(
    $G8,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$A:$A,0
    ),MATCH(
    Q$6,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$4:$4,0
    )
    ,1)
    )
    ,0,
    INDEX(
    'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$1:$65536,MATCH(
    $G8,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$A:$A,0
    ),MATCH(
    Q$6,'P:\Operating Statement\Payroll\[Week 45 0607 NAM.xls]Units'!$4:$4,0
    ),1
    ))

    +IF(
    ISNA(
    INDEX(
    'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$1:$65536,MATCH(
    $G8,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$A:$A,0
    ),MATCH(
    Q$6,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$5:$5,0
    ),1
    )
    )
    ,0,
    INDEX(
    'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$1:$65536,MATCH(
    $G8,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$A:$A,0
    ),MATCH(
    Q$6,'P:\Operating Statement\Payroll\[Month 11 0607 NAM.xls]Units'!$5:$5,0
    ),1
    ))
    /(52/12)

    Thanks in advance.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Hi
    You can try naming your formulas, like this site shows

    http://www.cpearson.com/excel/nested.htm
    http://www.cpearson.com/excel/named.htm
    Last edited by davesexcel; 07-31-2007 at 12:10 AM.

  3. #3
    Registered User
    Join Date
    07-30-2007
    Posts
    12
    Thanks for this reponse it was really helpful.

    The only issue I have now is that the formula is REALLY SLOW.

    I can only assume this is because it is opening and closing the linked file everytime I call the function even though I have the linked files open?

    Is there a quicker way to do this? As I am calling this formula ~ 50,000 times in the one spreadsheet.
    Last edited by mccardled; 08-22-2007 at 02:51 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