+ Reply to Thread
Results 1 to 5 of 5

Average Of A Coloumn Of Values, Based On A Critera For Each Value On That Value's Row

  1. #1
    Registered User
    Join Date
    11-15-2008
    Location
    Canada
    Posts
    3

    Average Of A Coloumn Of Values, Based On A Critera For Each Value On That Value's Row

    Hello, everyone. I'm new here and kinda new to Excel. I've used it before but only for really basic stuff.

    Anyway, I want to be able to take the average of a coloumn of values, but the criteria that I want to use is on the same row, but a different coloumn as that value.

    I could do it with two different tables, but it would clutter my spreadsheet, and it would force me to make a new table for each different criteria.

    The application for my question is to keep track of stats for an online war game.

    My particular application at this time is to get an average of various stats for ONLY successful or unsuccessful attacks, but not both. I have arranged the table so that each attack has its own row, and I'm using a 1 or a 0 to denote if the attack was successful or not.

    I'm not sure if I've phrased my question clearly or not, but it feels like it's a bit of a tricky and specific situation.

    Thank-you for any help that you can offer me.
    Attached Files Attached Files

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256
    Hello

    See Formulas in Green coloured cells on attached files. I hope this will help u.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-15-2008
    Location
    Canada
    Posts
    3
    Thank you for your help, Vandanavai!

    I've looked at the formulas in those cells, and I've looked at the help notes for those and they seem to make sense now...

    However, I am still left wondering if the $ marks are necessary to the function of these formulas. Could you please help me understand exactly how this works?

    Thank you!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,681
    The $ signs have no effect on how a single formula works, they are used to "fix" references when a formula is copied down or across, so the $ in front of the column reference R means that when the formula is copied across it remains an R. The reference to E15:E65536, however, you want to alter as you copy across from E9 so no $ is used.

    As you are only copying the formula across you don't strictly need the $ signs in front of any row numbers....and you probably don't need the formula to go down to row 65536 so, assuming you'd have data down to row 100 at most you could have this formula in E9 copied across

    =SUMIF($R15:$R100,1,E15:E100)/COUNTIF($R15:$R100,1)

    or to prevent a #DIV/0! error if there are no 1s in column R

    =SUMIF($R15:$R100,1,E15:E100)/MAX(1,COUNTIF($R15:$R100,1))

  5. #5
    Registered User
    Join Date
    11-15-2008
    Location
    Canada
    Posts
    3
    Thanks for your help.

    I've used the formula that Vandanavai suggested, but without the $ signs.

    Also, I wasn't sure how many rows I would need for this spreadsheet, so I chose to use 2^16, because it's a reasonably high value and I won't have to adjust my formulas for quite some time.

    Running into divide by zero errors isn't really a concern, but better safe than sorry, so I'll look into your formula, Daddylonglegs.

    My next question will be about retrieving data from a different spreadsheet in the same file. I'm not quite at that point in the development of this spreadsheet, but I will need to know how to do this within the next few days. I'm not sure if I should make new thread, or if this one will suffice. In any case with this query, I have yet to look through Excel's help files for this information, so a new thread may not be necessary at all if I find it in the help files.


    Thank-you for all of your suggestions! They are immensely helpful!
    Last edited by Zxcat; 11-16-2008 at 10:29 PM.

+ 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