Table summary formula

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I have a number of discrete tables which need summarising. they are in the format shown below, there are no formulae in them.
I need a formula that will pick up the diploma name and return some of the totals in a compact list, something like:
Diploma Pass Rate Transition
Art 91% 261
Maths 91% 261
etc.

Diploma of Art
DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
Art2018-229469%95%65.019
Art2018-176574%92%62.955
Art2017-310160%92%63.86
Art2017-236264%91%61.422
Art2017-111183%93%63.690
TOTAL49512055%91%62.5261
Diploma of Maths
DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
Maths2018-229469%95%65.019
Maths2018-176574%92%62.955
Maths2017-310160%92%63.86
Maths2017-236264%91%61.422
Maths2017-111183%93%63.690
TOTAL49512055%91%62.5261
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi, if the data is sitting in tables (and not ranges) then you can point to the total rows and tweak the formula.

Book1
ABCDEFGHIJKLM
1DiplomaPass RateTransitionDiploma of Art
2Art91%192DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
3Maths85%192Art2018-229469%95%65.019
4Art2018-176574%92%62.955
5Art2017-310160%92%63.86
6Art2017-236264%91%61.422
7Art2017-111183%93%63.690
8Total49512055%91%62,5192
9Diploma of Maths
10DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
11Maths2018-229469%95%65.019
12Maths2018-176574%92%62.955
13Maths2017-310160%92%63.86
14Maths2017-236264%91%61.422
15Maths2017-111183%93%63.690
16Total49512055%85%62,5192
Sheet1
Cell Formulas
RangeFormula
B2:C3B2=INDIRECT($A2&"[[#Totals];["&B$1&"]]")
M8,M16M8=SUBTOTAL(109,[Transition])
 
Upvote 0
Alternative is using INDEX in the reference form. This works if your tables always have the same number of lines?
Book1
ABCDEFGHIJKLM
1DiplomaPass RateTransitionDiploma of Art
2Art91%261DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
3Maths91%261Art2018-229469%95%65.019
4Art2018-176574%92%62.955
5Art2017-310160%92%63.86
6Art2017-236264%91%61.422
7Art2017-111183%93%63.690
8TOTAL49512055%91%62.5261
9
10Diploma of Maths
11DiplomaStart TrimesterCommenceEnrolledStart / Compl RatePass RateAvg MarkTransition
12Maths2018-229469%95%65.019
13Maths2018-176574%92%62.955
14Maths2017-310160%92%63.86
15Maths2017-236264%91%61.422
16Maths2017-111183%93%63.690
17TOTAL49512055%91%62.5261
Sheet1
Cell Formulas
RangeFormula
B2:C3B2=INDEX(($G$3:$M$8,$G$12:$M$17),MATCH("Total",$G$3:$G$8,0),MATCH(B$1,$G$2:$M$2,0),ROW()-1)
 
Upvote 0
Thanks Gra, appreciate that you've given me two ways to work this out. I've copied both straight onto Excel worksheets but I'm getting errors in the formulae, I'll work through this though. I did think about Index Match originally but couldn't get it to work.
 
Upvote 0
With pleasure. Perhaps this helps you even further then.
=INDEX(($G$3:$M$8,$G$12:$M$17),MATCH("Total",$G$3:$G$8,0),MATCH(B$1,$G$2:$M$2,0),ROW()-1)
This part: between parenthesis, separated by "," is the range from each table you'd like to fetch data from
This should be rather straightforward: from any table is looks for the row where you have "total" in the related column
The third argument finds the correct column position, again from any table
ROW()-1 is the table/range position of the first argument. So if you are starting your formulas in let's say row 25, you need to adjust this. Perhaps try ROW(A1).
 
Upvote 0
With pleasure. Perhaps this helps you even further then.
=INDEX(($G$3:$M$8,$G$12:$M$17),MATCH("Total",$G$3:$G$8,0),MATCH(B$1,$G$2:$M$2,0),ROW()-1)
This part: between parenthesis, separated by "," is the range from each table you'd like to fetch data from
This should be rather straightforward: from any table is looks for the row where you have "total" in the related column
The third argument finds the correct column position, again from any table
ROW()-1 is the table/range position of the first argument. So if you are starting your formulas in let's say row 25, you need to adjust this. Perhaps try ROW(A1).
Thanks for the explanation. I like your INDIRECT function, do you need to use subtotal as per your example?
 
Upvote 0
You need to use a Total row, so the syntax I proposed worked. How you fill out that Total row does not matter. I went with the auto sum feature of tables, which uses subtotals. You can even hardcode values as well, though they are considered as text values then.
Bare in mind, indirect is a volatile function. And at each update, filtering, .... the calculation engine kicks in to recalculate the whole workbook. Like I said, you can also point to the correct total cell. If you have named your tables, which I did and I forgot to mention that in my first reply, you can replace that part of the formula. Try typing = TableName, and see what happens...
 
Upvote 0
Thanks again Gra.
On a similar theme among the tables I need to consolidate and analyse are tables in the format below which I've simplified for the sake of the example. There are as many as 30 to 40 tables at a time to process. I need the formulae to return, it needs to be able to collect the 2019 - 3 results and pick up the diploma name from the table name (which is the part that I am having trouble with).

Diploma 2019-3 Pass rate Avg marks
Art 88 59
Maths 79 56

The data is in this format:
Table 3.2 - Diploma of Art
Commence TrimesterPass RateABAvg Mark
2019-3
88%​
XX
58.6​
2019-2
91%​
XX
62.7​
2019-1
87%​
XX
60.4​
2018-3
90%​
XX
63.0​
Total
91%​
XX
62.5​
Table 3.3 - Diploma of Maths
Commence TrimesterPass RateABAvg Mark
2019-3
79%​
XX
58.5​
2019-2
85%​
XX
62.7​
2019-1
85%​
XX
61.8​
2018-3
85%​
XX
64.1​
Total
85%​
XX
62.3​
 
Upvote 0
Hi,
In this case I would use a Power Query solution. Assuming all those tables are on the same sheet called "Diplomas".
  1. get data from file -> from workbook
  2. navigate to the workbook (even if it is the one that's open :) )
  3. in the navigator select the sheet "Diplomas" and hit Transform Data button
  4. You may need to demote headers when the first table starts in row 2, PQ may pick this up as a column header.
  5. Add a custom column, like in example below picture 1
  6. With this new column highlighted, on the transform step select Fill and fill down
  7. Like in Excel filter the table on Column 2 and Remove "null" from the selection
  8. Promote headers (use first row as headers is a button on the Transform tab)
  9. Filter out again, on any of the columns the repeated headers
  10. Finally select the rows containing 2019 (which we can make a dynamic selection if required)
  11. Move last column to first position (select header, and mouse right click, look for "Move" in the context menu and move to beginning)
  12. Save and load to Excel as table or as pivot table.

1587127294049.png


Result looks like this
1587127665203.png
 
Upvote 0
Thanks again again Gra. The Power Query option looks like it will do the trick. On my current computer the Power Query option doesn't come up but I will explore it further in the near future.
I was thinking if I cleaned up the titles on the tables such that all that was left was the actual Diploma name eg Maths, could we use an Index Match Match to return a pass rate for 2019 - 3 for example? In other words the Match parts of the formula would have to read the same column twice which I haven't seen work before. The Index and Match Match work great in two way lookups when you reference the intersection of a row and column but I can't get it to work when it refers to the same column. Possibly there is another function that could be used in this case?
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,303
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top