+ Reply to Thread
Results 1 to 3 of 3

"IF" formula too long, can someone help me shorten it?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-25-2005
    Location
    Las Vegas, NV
    MS-Off Ver
    2010
    Posts
    10

    "IF" formula too long, can someone help me shorten it?

    ive got the following formula

    =SUM(IF(B4<>0,'AZG'!B4,"0"))+(IF(C4<>0,'[2005_Goals.xls]AZG'!C4,"0"))+(IF(D4<>0,'[2005_Goals.xls]AZG'!D4,"0"))+(IF(E4<>0,'[2005_Goals.xls]AZG'!E4,"0"))+(IF(F4<>0,'[2005_Goals.xls]AZG'!F4,"0"))+(IF(G4<>0,'[2005_Goals.xls]AZG'!G4,"0"))+(IF(H4<>0,'[2005_Goals.xls]AZG'!H4,"0"))+(IF(I4<>0,'[2005_Goals.xls]AZG'!I4,"0"))+(IF(J4<>0,'[2005_Goals.xls]AZG'!J4,"0"))+(IF(K4<>0,'[2005_Goals.xls]AZG'!K4,"0"))+(IF(L4<>0,'[2005_Goals.xls]AZG'!L4,"0"))+(IF(M4<>0,'[2005_Goals.xls]AZG'!M4,"0"))

    essentially im trying to only pull a value from another spreadsheet only if the corresponding value on this spreadsheet is populated.

    This formula seems to work, but when i exit out, it fills the exact reference for the file path, and i run out of characters (255 char. limit)

    is there a way to leave the naming absolute [goals.xls]?

    Is there a way to simplify my formula?

    Below is what i get when it populates the full path:

    =SUM(IF(B4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!B4,"0"))+(IF(C4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!C4,"0"))+(IF(D4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!D4,"0"))+(IF(E4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!E4,"0"))+(IF(F4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!F4,"0"))+(IF(G4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!G4,"0"))+(IF(H4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!H4,"0"))+(IF(I4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!I4,"0"))+(IF(J4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!J4,"0"))+(IF(K4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!K4,"0"))+(IF(L4<>0,'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!L4,"0")) M4<>0 'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goal

  2. #2
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    Try this:

    =SUMIF(B4:M4,"<>0",'C:\Documents and Settings\Owner\Desktop\Goals\[2005_Goals.xls]AZG'!B4:M4)

    Ola Sandström

  3. #3
    Registered User
    Join Date
    02-25-2005
    Location
    Las Vegas, NV
    MS-Off Ver
    2010
    Posts
    10
    i get #VALUE when i use that formula.

    thanks for the help, any other suggestions?

+ 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