+ Reply to Thread
Results 1 to 6 of 6

Average only the Sheet/Cell with data...

  1. #1
    Registered User
    Join Date
    12-08-2006
    Posts
    3

    Post Average only the Sheet/Cell with data...

    New at the Excel thing, so forgive my lack of knowing.
    I have 13 sheets 12 of them for each month (Jan-Dec) and Results sheet.
    During each month the sheet get filled in with each day’s total credits and debits and sum them up for a monthly total and also give a difference of those totals. This works ok.
    On the results sheet I would like to average the credits and debits and sum the month as they are filled. I can do this but not less the month not filled in yet. I am average them by all 12 even if there is no info. How can I exclude the month the totals are $0.00.
    On the Results it now looks like this for credits and I change the C27 with D27 for debits. What can I change to not include the month/months were the totals are still $0.00.

    =AVERAGE('January 2007'!C27,February!C27,March!C27,April!C27,May!C27 ,June!C27,July!C27,August!C27,September!C27,Octobe r!C27,November!C27,December!C27)

    ps attached file also seems I put first put this in wrong forum , sorry.

    Thank for any help!
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this array (Ctrl + Shift + Enter).

    As the summary page already ref the other sheets use range C11 to C22

    =IF(ISERROR(AVERAGE(IF(C11:C22>0,C11:C22,""))),0,AVERAGE(IF(C11:C22>0,C11:C22,"")))



    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-08-2006
    Posts
    3

    Thanks VBA NOOB!

    I see were you are going by using data on Referance sheet.
    But I am getting an error with your array. Could be someting I am doing wrong.
    Thanks again!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this.

    Let me know what error your getting if it still not working for you

    VBA Noob
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-08-2006
    Posts
    3

    Thanks!

    Thank you that works.
    Not sure what I done wrong to get the error but it was my bad.
    I am not sure what your array all means but I will keeps studing on it.
    The main thing for now is it works and you gave me a better idear for totaling the yearly bottom line.
    Thanks!!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad it worked for you.

    The attached link explains more about arrays

    http://www.cpearson.com/excel/array.htm

    VBA Noob

+ 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