+ Reply to Thread
Results 1 to 6 of 6

Average Function

  1. #1
    Registered User
    Join Date
    01-20-2009
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    33

    Exclamation Average Function

    I am attempting to Average across four unbound cells. Some may have values or may not. I am using the following formula:

    =(Nz([Dif1],0)+Nz([Dif2],0)+Nz([Dif3],0)+Nz([Dif4],0))/(IIf(IsNull([Dif1]),0,1)
    +IIf(IsNull([Dif2]),0,1)+IIf(IsNull([Dif3]),0,1)+IIf(IsNull([Dif4]),0,1))



    Where: Dif1 = 1
    Dif2 = 1
    Dif3 = 1
    Dif4 = 0

    The answer being generated is 6 when it should be 1.

    Thanks Again

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Average Function

    What are Nz and Iif? Excel 2003 (your profile) does not support structured table references, and neither NZ nor IIF are worksheet functions.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-20-2009
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Average Function

    This is in regards to Access 2003. "Nz" is in regards to Null values and IIf is the same as in Excel but for Access.

  4. #4
    Registered User
    Join Date
    01-20-2009
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Average Function

    Dif1, Dif2, Dif3 and Dif4 are the names of the unbound cells in an Access 2003 form.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Average Function

    My apologies -- I completely missed that this was in the Access forum.

  6. #6
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Average Function

    One question before I present a possible solution. Can a cell ever contain "0" and you want it to be part of the average?

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

+ 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