Total multiple tables Excel 2013 - excel

I am attempting to sum multiple tables' subtotals together to create a grand total. I've found a method to do so by naming the table and and then using =sum(tableName[columnName]). Therefore I could just add several of them together to achieve my result.
However, when I look at the pre-loaded templates, there is one called Family Monthly Budget where they have a total table that sums multiple tables showing only a single entry =totalExpenseProjected. When I click that cell, it highlights as a formula, but gives no indication as to how its calculated and I cannot recreate it using my own spreadsheet.
Can anyone offer insight on how to use the microsoft method?

If you go into the Formulas->Name Manager you will see this named range is really a mess of a SUM formula:
=SUM(Actual1,Actual2,Actual3,Actual4,Actual5,Actual6,Actual7,Actual8,Actual9,Actual10,Actual11,Actual12,Actual13)
That SUM is using other named ranges. A sample of the formula in Actual1 is:
=Housing[[#Totals],[Actual]]
It then repeats that for the other 12 Actual references.

Related

Using XLOOKUP when dynamically assigning rank to a table does not pull the correct data

The issue I am having is trying to use XLOOKUP on a table column that has been generated using a ranking formula.
The Rank column is created using the following formula so that it adjusts dynamically depending on the visible columns (auto-filtering) since RANK.AVG or EQ does not take that into account.
=SUMPRODUCT(SUBTOTAL(3,OFFSET(Table2[[#All],[Sales]],ROW(Table2[[#All],[Sales]])-MIN(ROW(Table2[[#All],[Sales]])),0,1)),--([#Sales]<Table2[[#All],[Sales]]))
The XLOOKUP I am using is simple
=XLOOKUP(1,Table2[Rank], Table2[Rep])
The idea is that the field at the top would show the top ranked performer based on the visible rows. The problem is that when filtering the data, the rank column adjusts as it should, but the XLOOKUP does not function as I would expect. It sticks with the originally ranked 1 or even does something complete weird that I can't explain when running combinations of filters in the region column..
Anyone have any advice how I could better structure this to make it function in the intended manner. Any help at all would be appreciated.
You'll need to employ a similar construction to account for visible rows only, for example:
=LOOKUP(1,QUOTIENT(0,SUBTOTAL(3,OFFSET(INDEX(Table2[Sales],1),ROW(Table2[Sales])-MIN(ROW(Table2[Sales])),))*(Table2[Rank]=1)),Table2[Rep])
Not sure why you're referencing the table header row in your other formula.

Excel Macro to perform a formula where one column has the same value in several rows

I can't quite find the right code example to do what I'm looking to do.
We have an excel file with data from a project where a request can have several TASKs associated with it and different teams or organizations can be assigned. I'm trying to create a summary of whether the request was worked on by one team or another or "jointly" worked on (based on more than one team/org being assigned to tasks under the same request).
Here is the example and the result I'm looking for:
I want the code to be able to loop thru all rows checking where column A (request #) is the same value and builds an array of the value contained in column B (Team assigned) for each row where A has the same value. Then some sort of function to determine if the values in the array contain more than 1 team. If all of the TASKs were worked on by one team, just that team is the result, if more than one team worked on TASKs, the it results with "Joint".
This can be done without VBA, using formulas.
For the Result column in my screenshot, column E, I used
=IF(COUNTIFS([request],[#request],[team],[#team])=COUNTIFS([request],[#request]),[#team],"Joint")
The same formula without structure references reads like this:
=IF(COUNTIFS($B$3:$B$22,B3,$c$3:$c$22,c3)=COUNTIFS($B$3:$B$22,B3),E3,"Joint")
Apply the formula to the whole table column. If you don't want to use structured references, make sure to use absolute references for the column ranges, i.e. $B$3:$B$22 etc.
The Pivot table has Request and Result in the row areas, and the Tasks in the Values area. A pivot table needs to be refreshed when new data is added.
A dynamic result table can be achieved with the new dynamic array formulas available in Office 365 versions of Excel.
In H12 and I12 of my screenshot I use
=UNIQUE(Table1[request])
=XLOOKUP(H12#,Table1[request],Table1[Result])
The formula automatically spills down as far as required.
So, no VBA required, which means you can save as a regular .xlsx file, which will also run perfectly fine in the browser and on mobile devices.

Insert subtotal for Excel spreadsheets

I have some irregular data (e.g. I have 5 groups of data, each group occupies different amount of rows) and I am wondering if there is a way to use Python to add subtotal to all of my spreadsheets, breaking at each group change.
Since row amount is irregular for each group, I tried inserting empty row at each change and adding a subtotal. However, I am unable to do a sum for each change or a grand total without using hard code (specify on the row number, which changes for every spreadsheet).
Thanks in advance.
Edit: Added code I am working on
for num in range (8, ws.max_row+1):
if ws['E'+str(num)].value == ws['L1'].value:
ws['L'+str(num)]='=SUMIF($A$'+str(ws[num])+':$A$'+str(ws[ws.max_row])+',LEFT(A'+str(ws[num])+',6),$E$'+str(ws[num])+':$E$'+str(ws[ws.max_row])+')'
num+=1
Can you add a column to each list that can help you categorize them? that way you can do a =SUMIF based on the categorized names. here's a code snipit and an image to reference:
=SUMIF(B:B,B15,C:C)
the formula calculates the left table (dogs).
as you can see the totals wont be added if the category is mentioned. also, all three tables are irregular so it will add up regardless of length.

Tableau: hide table calculation for only one column

I'm working on a visualization in Tableau, regarding numbers for actual figures, budgets, and estimates. For budget and estimate, I also want to show the percentage of difference compared to the actual. I have these numbers for several categories.
I recreated an example as below.
What I now want is: Hide the percentage calculation ONLY for the actuals column.
I tried several things. but it always ends in multiple columns being deleted. How can I do this?
(Percentages are calculated across table and based on "actual" scenario).
Edit 1: As in one of the answers, creating seperate calculated fields for each value is an option. But in my problem, I will have a lot of measures where I want to disply it this way. So creating 5 calculated fields for every measure is really a last option.
Also: I now solve it using 2 different sheets on the dashboard. One sheet with actual numbers, and one sheet with percentages (hiding the actual column). But then the line up is not so nice, and also when the sorting of the dimension changes, it is tricky. I have also options to drill down the hierarchy of a dimension, and with two sheets, one of the two will of course not adapt then.
Currently you are using F1 for rows and F2 for columns and measures that will split to as many values as F2 has (Currently their are 3 columns).
Solution that I can think of in this particular case is to remove F2 from columns part and create 5 formulas for the measures.
Actual Sum // Since we don't want Acutal (%diff) we won't create that formula
Budget sum
Budget (%Diff)
Estimate Sum
Estimate (%Diff)
Now formula will be like
If F2 = "Actual" //Same goes for Budget and Estimate
Then f3
End
Take one more sheet now add the quick table calculation for difference for Budget and Estimate and add those to Formula fields.
Now place all 5 formulas in columns part, So you have your measures.
To add the column headings you can use dashboard, Add the sheet to dashboard and manually add texts to the measures that will look like the one you have attached in screen shot.
I have implemented a sample using Sample super store and attaching the screenshot for the same.

Using arrays and table names for unique value list

I am building a summary tab in an excel workbook that is linked to numerous other workbooks to track hierarchical business data (ie. Numerous files for subordinate teams exchanging data with a master workbook that tracks them all). To make it easier and to increase uniformity, I'm using tables for all of the data and "building" table names based on each spreadsheet's specific criteria -- then using INDIRECT to bring the table references to life and complete my calculations.
To simplify the formulas I'm using, I've been using arrays to check all tables at once for pieces of data. For example, I've built a table for subordinate units (Ref_Units) which contains the units' names: ABC, EFG, XYZ. I then have a table (Ref_Tables) translate my Ref_Units into standardized table names. Formula is something like {=Ref_Units&"_2016_Sales_Rpt"}. Now I can make some SUMIFS using Ref_Tables that look in several different locations for data -- and to make updates, I only have to change Ref_Units.
My Summary tab will be the culmination of data coming from a dozen+ tables and upwards to 10 workbooks. The basis of the summaries are gathered from drop down lists specifying categories and years being summarized; these values are plugged into some INDIRECT formulas to generate table names and voila.
Now, the problem: let's say each unit records sales numbers and projections for specific items like "televisions", "stereos", "flatware", "candles", etc. and each of these items has also has a category accompanying it: "Electronics","Homewares", "Decor", etc.
I want a summary spanning all of the units' data pulling the numbers in each category (I should note that categories may change each month, so the list must be dynamic). To make the list dynamic (and to give myself the ability to summarize based on other criteria), I am using a formula I found online to generate a list of unique/distinct values.
Right now, I'm using INDEX/MATCH and COUNTIF to generate a unique list of categories. So, my unique list starts in cell C9 and the formula looks something like this:
{=iferror(INDEX(INDIRECT(Ref_Tables&"[Category]"), MATCH(0, COUNTIF($C$8:C8, Ref_Tables&"[Category]"), 0)),"")}
This function will not work. The only way I can get the desired results is to input multiple iterations of the formula, each using a single table name from Ref_Tables and joined with &.
Example:
{=iferror(INDEX(INDIRECT("ABC_2016_Sales_Report"&"[Category]"), MATCH(0, COUNTIF($C$8:C8, "ABC_2016_Sales_Report"&"[Category]"), 0)),"")&iferror(INDEX(INDIRECT("EFG_2016_Sales_Report"&"[Category]"), MATCH(0, COUNTIF($C$8:C8, "EFG_2016_Sales_Report"&"[Category]"), 0)),"")&iferror(INDEX(INDIRECT("XYZ_2016_Sales_Report"&"[Category]"), MATCH(0, COUNTIF($C$8:C8, "XYZ_2016_Sales_Report"&"[Category]"), 0)),"")}
**Remark: the look up arrays are strangely input here because they are actually cell references pulling in table name and column name being looked up, then brought to life with INDIRECT
Partially my problem is that the resulting formula is about 10 lines long which looks horrible, but it also looks too confusing to anyone using the workbook.
Is there any way to get the INDEX/MATCH to look at multiple tables for generate the list that is more concise?
I should note that my boss refuses to use VBA/macros/pivot tables because there are not many in my office skilled enough to troubleshoot issues in these areas. Help?

Resources