+ Reply to Thread
Results 1 to 7 of 7

How to sum two fields w/possability of null values & using iif function?

  1. #1
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    How to sum two fields w/possability of null values & using iif function?

    I have the formula below... I only want to sum up the B Bal & G Bal field if the subsytem = CLS but I get "The expression you entered has a function containing the wrong number of arguments."

    IIf([M_SUBSYS_ID]="CLS",SUM(Nz([B Bal])And Sum(Nz([G Bal]),"")))

    can anyone think of why??
    Last edited by jgomez; 05-07-2012 at 05:25 PM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to sum two fields w/possability of null values & using iif function?

    Hi

    Yoy mean something like this?

    =If([M_SUBSYS_ID]="CLS",SUM(Nz([B Bal])+(Nz([G Bal]),"")))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    Re: How to sum two fields w/possability of null values & using iif function?

    I get Syntax error (comma) in query expression "i=If([M_SUBSYS_ID]="CLS",SUM(Nz([B Bal])+(Nz([G Bal]),"")))'.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to sum two fields w/possability of null values & using iif function?

    =If([M_SUBSYS_ID]="CLS",SUM(Nz([B Bal])+(Nz([G Bal]),""))

    Or even better.

    Would you like to upload a small sample workbook, for us??
    Last edited by Fotis1991; 05-07-2012 at 04:46 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    Re: How to sum two fields w/possability of null values & using iif function?

    Couldn't save & enter your formula... just enter it & you will get error message just take out the = sign & make sure you type in "iif" not "if"
    Attached Files Attached Files

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to sum two fields w/possability of null values & using iif function?

    I Can "open" your file.


    It's says that is an ACCDB File

    Sorry...

  7. #7
    Valued Forum Contributor
    Join Date
    12-22-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & Excel/Access 2007
    Posts
    438

    Re: How to sum two fields w/possability of null values & using iif function?

    Got it! Its

    Relationship Bal: IIf([M_SUBSYS_ID]="CLS",Nz([B Bal])+Nz([G Bal]),"")

    & thanks Fotis!

+ 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