Beh162

Q: Count how many wins across tabs

I'm trying to create a table on my summary tab "Total Weekly Wins" that will count how many times someone has one each week and run that tally.  The information is on weekly tabs Week 1 - 17.  There is a Aux table in each weekly tab that labels the winner for that week.  The Aux tables are now labeled identical.

I have an idea of some formula's but I'm not sure how to reference the name associated with the "Winner!" to add to the sheet, and then to add an Index formula so it checks each week.  In the screen shot below Trisha wins so I wanted a 1 to go next to her name.  And so on as the weeks go on.

Screen Shot 2016-10-19 at 10.35.07 PM.png

Screen Shot 2016-10-19 at 10.36.56 PM.png

iMac with Retina 5K display, null

Posted on Oct 19, 2016 7:51 PM

Close

Q: Count how many wins across tabs

  • All replies
  • Helpful answers

  • by Barry,Solvedanswer

    Barry Barry Oct 20, 2016 2:36 PM in response to Beh162
    Level 7 (32,714 points)
    iWork
    Oct 20, 2016 2:36 PM in response to Beh162

    Hi Beh,

     

    Accumulating summary data across a number of tables is always more difficult that extracting similar data from a single table, but is doable, especially what the several contributing tables are sequentially named.

     

    I'd suggest a two step approach here:

    1. Collect the Winner! data from all of the auxiliary tables.
    2. Summarize the collected data.

     

    The data to be collected in on row 5 of each of the auxiliary tables. Names of the participants are in row 1 of each auxiliary table, and are in the same order on each.

     

    The auxiliary tables are organized with the names across the first row; your proposed "Total" table is organized with the names in the first column, which complicates matters. I would suggest using the Auxiliary table pattern for calculating the results, then transposing them to the pattern of the Total table.

     

    Here's a sample set of Aux tables for 10 weeks (Aux1 is the table in my earlier example, Aux2 through 10 are copies of that table with random "W"inners inserted in the bottom row.

    Screen Shot 2016-10-19 at 10.50.18 PM.png

    Summary:

    All Aux tables contain the "W"inner results in row 5. (Aux1 also includes "n" in non-winner cells—a leftover from my early tests.)

    Names of these tables are identical except for the number indicating the week to which the Aux is linked. This allows the Row number, or a number in column A of the Summary table to be used in composing an INDIRECT reference to row 5 of each table. The names of these tables are distinct within the document, so the Sheetname for each may be omitted from the range reference constructed with INDIRECT

    Screen Shot 2016-10-19 at 11.07.56 PM.png

    Row 1: The names in Row 1 are direct transfers from the Row 1 cells of Aux1. Because they address a single table, INDIRECT is not necessary here:

     

    Summary::B1: INDEX(Aux1::1:1,COLUMN())

    Fill right to column F.

     

    Rows 2 through 11: Each row collects the "W" and null string values (or "n"s in row 2) from one of the Aux tables:

     

    Summary::B2: INDEX(INDIRECT("Aux"&$A2&"::A:F"),5,COLUMN())

    Fill Right to column F

    Fill down to row 11

     

    Row 12: This is a Footer row. The formula in each column counts the number of "W" occurrences in its column.

    Summary::B12: COUNTIF(B,"W")

    Fill Right to column F.

     

    Total Weekly Wins:

     

    This table uses INDEX to copy the names in Row 1 of Summary into column 1 of TWW, and to copy the totals from Row 12 of Summary into column 2 of TWW.

     

    Total Weekly Wins::A2: INDEX(summary::$1:$1,ROW())

    Total Weekly Wins::B2: INDEX(summary::$12:$12,ROW())

     

    Fill each down its column as many rows as there are names across Row 1 of Summary.

     

    Regards,

    Barry

  • by Beh162,

    Beh162 Beh162 Oct 20, 2016 8:32 AM in response to Barry
    Level 1 (5 points)
    iWork
    Oct 20, 2016 8:32 AM in response to Barry

    In my Aux tables I never created a First column that says T-B, Pt, W so when I plug in that formula: Index(Aux1::1:1,COLUMN())  it's skipping the first person.  When I delete Column A in the Summary tab it's brings the names in correct.  Which I think deleting this is causing an issue with the next formula in B2 because it doesn't have a week# to reference.

     

    Next

    Summary::B2:

    I'm plugging in this formula and getting a reference error and I'm wondering if that's because I'm missing a column in all my Aux tables.  Should I be fixing my Aux sheets to add in the that missing column?  Or is there a different fix.

  • by Beh162,

    Beh162 Beh162 Oct 20, 2016 2:37 PM in response to Barry
    Level 1 (5 points)
    iWork
    Oct 20, 2016 2:37 PM in response to Barry

    Got it fixed! Thanks so much

  • by Barry,Helpful

    Barry Barry Oct 20, 2016 4:24 PM in response to Beh162
    Level 7 (32,714 points)
    iWork
    Oct 20, 2016 4:24 PM in response to Beh162

    Both issues are due to a mismatch in the number of columns in Auxn and Summary.

     

    Summary::B1: Index(Aux1::1:1,COLUMN())

     

    This tells Numbers to look into row 1 of Aux1 (the range) and return the value from the nth column of the range.

     

    COLUMN() returns the number of the cell in which the formula sits. B is column 2 of the its table, so COLUMN() returns 2, and the IINDEX formula returns the value from the second cell in row 1 of Aux1.

    When you delete Column A of Summary, B1 becomes A1. The formula now sits in column A, COLUMN() returns 1, and  INDEX returns the value from the first cell in row 1 of Aux1.

     

    Summary::B2: INDEX(INDIRECT("Aux"&$A2&"::A:F"),5,COLUMN())

     

    Without the header column, your Aux tables have only five columns: A, B, C, D, and E. The formula references columns A:F of an Aux table. The 'bad reference' is to column F, which does not exist on the Aux table(s). Change 'F' to 'E'

     

    Deleting column A of Summary puts COLUMN() in step with the data positions on Aux, but also removes the existing column A, which contains the Week numbers used to build the indirect address pointing the the individual Aux tables.

     

    You can replace '&$A2&' with '&ROW()-1&' and get the same result, but without the visual week numbers on the Summary table,

    OR

    You can leave the rows and columns of the Summary table as is, and replace 'COLUMN()' with 'COLUMN()-1' in the formula to collect the data in column A of the Aux tables in Column B of Summary.

     

    Regards,

    Barry