SUMPRODUCT: calculating multiple sheets - excel-formula

Purpose:
I have 13 tabs. Tab one consolidates data from other sheets using fairly simple formulas. I am attempting to create a formula that will provide a total sum from all 12 sheets by identifying which "team" the charge belongs to. The sheets look similar to the following:
Amount Team
$52.00 Team Bob
$2.52 Team Gene
I will need the total for each "team" to be tallied on the beginning summary page.
This is the formula I built.
=SUMPRODUCT(--('January 14'!H3:H31="Team Bob"),'January 14'!G3:G31)+('February 14'!H3:H31="Team Gene"),'February 14'!G3:G31)
The first half works (in bold), but when I try to add the formula to pull from the next tab it highlights "G31" and does not make recommendations on how to repair. How do I add additional tabs so that I have the data from January added with all other months?

A more generic way of doing this is using the =INDIRECT function - which lets you construct your reference by giving it the sheet name/range. Here's an example:
https://spreadgit.com/bjoern/monthly-tabs-sum.xlsx/sheets/Summary

Related

Excel - Combining same names in 3 different sheets and adding their values

This is a project in school, sorry I just have a basic VLOOKUP knowledge in Excel. I have three sheets named: pasta, pastries and cakes. So basically this is a tally of how much we sell, and on the 4th sheet, we must list the TOTAL payment each person ordered from each of the 3 products above.
so in the images, those 3 sheets are the total payment each person must pay on each product. If you notice, there are duplicate names within the SAME SHEET and WITHIN THE 3 SHEETS. Like Joey's name appears twice on the pastries sheet, and once in the cakes sheet.
So basically i think you're getting my drift, I want in sheet 4 to appear all the payments joey must make in all three products. Basically determining/looking up all same names and adding all the values, then listing everyone else. The closest end I was able to achieve in consolidate was to create 3 more tables in sheet 4 with each product, VLOOKUP all info, create a 4th table in sheet 4, and do consolidation (see sheet 4). But the problem is other than the fact that it is such a mess, they do get consolidated, but only after the consolidate program is entered. But if another input was made in the other 3 sheets, lets say joey buy 3 more pastas, it does not update anymore. Clicking create links in consolidation puts out an error.
I tried searching on youtube and forums stating the way of "Consolidate", but it always either messes up the whole sheet, adds a column in between, and other stuff. So I may want to do this in VLOOKUP way, so that it can be dynamic, meaning that the consolidation changes automatically EACH TIME an input is made/changed. And it is much cleaner, as I do not have to create 3 more tables in sheet 4 to show the summary of each product.
Consolidating names from individual sheets is not done in a straightforward way with formulae. You have to resort to VBA for that, which I assume is not in the scope of your project.
However, assuming that in sheet 4, you have all names lined up in the first column, the summation is easily done with SUMIF.
If this is your source sheet
In your new sheet, line up all names on column A, preferably sorted.
Add a column for each food item, say Pasta, Pastries.
Use this formula in each row.
=SUMIF(Sheet1!A2:A7,Sheet2!A3,Sheet1!B2:B7)
First column above Sheet1!A2:A7 is the list of names. Sheet2!A3 is the current name in question. Sheet1!B2:B7 is the amount due.
This would total each food item under that person. Finally you can have a total column to give the total across all food items. If needed hide the individual food totals. So finally, you might have something like below. Hide columns B and C in the end, if needed.

Excel formula to get specific data that according to another column

I have a spreadsheet that contains various sheets, each sheet contains different types of orders including items, descriptions, quantity, etc.
ITEM DESCRIPTION QTY
Apple ... 1
Orange ... 4
I would like to get a formula that is capable to find out the total quantity of items from every sheet.
If you want to do it in a single cell, I'm afraid the only way of doing so without VBA is to make a manual search over all the pages :
= SUMIF(Page1!A:A,"=ItemName",Page1!C:C)+ SUMIF(Page2!A:A,"=ItemName",Page2!C:C)+ ...
Other solutions would involve you creating your own personal vba function or adding new cells in each sheet which I'm not sure are within the realms of possibilities.
If all your sheets with "data" on them are the same format, you can save time and maintenance by doing the following:
create a sheet called start which is before all the "data" sheets. This sheet should be blank (except perhaps for a bit of text saying "this sheet is intentionally blank")
create a sheet called end which is after all the "data" sheets.
Then in your summary sheet, you can do =SUM(start:end!C:C) (I'm assuming your quantity is in column C from your example above).
If you use this approach, you can easily add sheets in between start and end; the formula will not need to be rewritten
Per #l3echod's comment in another answer, you can also use this pattern in SUMIF and SUMIFS formulae, if you want total quantity per item:
=SUMIF(start:end!$A:$A,$A2,start:end!$C:$C)
this assumes the item in question is in cell A2. Note that depending on the volume of data you have, this might be a slow formula to calculate.

Total multiple tables Excel 2013

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.

Count/If/Sum formula

I am using a spreadsheet to count sold items for several teams.
Rows: Individual Seller
In column A I have the specific team the seller belongs to.
In column B I have the amount of items that the seller sold.
In a separate row at the end of the document, I am trying to calculate the total number of items being sold from a specific group.
Can anyone help me write the code needed to return the total number of items sold for each specific team?
The image shows some sample data in A1:C13, and three different ways to sum the amounts by teams. There are many others ways. Of the three I recommend #Jerry’s suggestion of a PivotTable (E2:F6) because it is very easy to set up, very quick in operation and offers a great deal of versatility beyond merely summing amounts by team. For example if your data included dates of sales it could sort and group by week, month, year etc. The second version of it (E8:F14) shows a breakdown by Seller of the 20 total, but by the number of ‘sales’ (rows) rather than number of items sold.
The formula in D20 (copied down to D22) is:
=SUMIFS(B$2:B$19,A$2:A$19,A20)
However SUMIFS was not available as a standard MS Office function before Excel 2007, though SUMIF was, so in B20, also copied down to suit:
=SUMIF(A$2:A$19,A20,B$2:B$19)
SUMIFS allows more conditions than SUMIF, so for example can be changed in D20 to:
=SUMIFS(B$2:B$19,A$2:A$19,A20,C$2:C$19,"Seller1")
to obtain the amount of items comprising the two distinct ‘sales’ by Seller1 as shown by 2 in the lower PivotTable.
Since you are trying to calculate the total from a specific group the above may be more elaborate than your immediate requirement so a version that can be placed almost anywhere in your sheet (if as the example) and even copied around, replaces a variable with a fixed condition, which I have chosen to be teamB:
=SUMIF($A$2:$A$19,"teamB",$B$2:B$19)
and provided the formula is kept out of ColumnA might be further simplified by extending it to consider entire columns:
=SUMIF(A:A,"teamB",B:B)

Excel: Multiple Vlookups to pull in 1 data element

I have 2 separate sheets in Excel. On sheet 1, I am using the following if statement in column C (hours) to pull in a number in column D (hours) from sheet 2.
=IF(ISERROR(VLOOKUP(A2,Sheet2!A:D,1,FALSE)),"N/A",VLOOKUP(B2,Sheet2!A:D,4,FALSE))
The first vlookup is validating the project number on the second sheet, then the second vlookup is validating the team name and pulling in the hours from the second sheet.
The problem is that when I copy the formula down the column, the hours value repeats for the same team name. Does anyone have any suggestions?
Sheet 1
columns
Proj_Number Team Name Hours
123456 R&D 26
123456 Dev 50
123456 QA 10
777777 R&D 26
Sheet 2
Proj_Number Team Name Organization Hours
777777 R&D AUTO 26
123456 DEV AUTO 50
123456 QA AUTO 10
123456 R&D AUTO 20
You are asking VLOOKUP to do something that it cannot do. The second VLOOKUP in your IF formula:
VLOOKUP(B2,Sheet2!A:D,4,FALSE)
is being asked to return the first instance of 'Team Name' that it finds on sheet 2; which it is doing.
If you want to return the number of hours based on the 'Team Name' and 'Proj_Number', you need to do it a bit differently.
One way is to create another column on Sheet2, maybe called 'Proj_plus_Team', (inserted at column C location) that concatenates the values in 'Proj_Number' and 'Team Name'. Then you can search on this new column using the following formula:
VLOOKUP(A2 & B2,Sheet2!C:E,3,FALSE)
Also, when doing this, make sure that the data on Sheet2 is sorted alphabetically on the values in column 'Proj_plus_Team'. VLOOKUP requires that the search column be sorted alphabetically or inaccurate results may be returned.
Option 1 - using formulas
LOOKUP is designed to retrieve a single value, which is what it's doing. It loops through a data range, checking whether the value is bigger/smaller than the reference value, and retrieves the first transition point. In your case, it finds the first match and stops, not what you're after at all.
If you want to do this using formulas, you'll probably find SUMIF() and the newly added in 2007 SUMIFS() to be a much cleaner route. Also, side-note, in Excel 2007 Tables are your new best friend, they tidy the formulas for this kind of thing right up and look after things like expanding ranges.
Your example above, using tables, would be translated to:
=SUMIF(Table2[Team],Table1[[#This Row],[Team]],Table2[Hours])
where Table1 is the equivalent of your Sheet1, and Table2 maps to Sheet2
Of course the reason that this won't provide what you're after is that this is summarising by team only, whereas you want to apply 2 filters, so you'd move to SUMIFS() and end up with:
=SUMIFS(Table2[Hours],Table2[Proj_Number],Table1[[#This Row],[Proj_Number]],Table2[Team],Table1[[#This Row],[Team]])
The benefit is that your formula will always recalculate automatically, the downside is that you have to manually update your Table1.
Option 2 - pivot tables
Insert --> Pivot table will create your pivot table, set the range as appropriate.
Then drag Project Number into Row labels, drag Team name below it also in Row labels, and drag Hours into the Values box.
That'll give you a breakdown by project by team of how many hours. You can then mess around with the options to get it exactly how you want, by doing things like turning off the level 1 summaries. Those kind of options are best found by experimentation, they live in the PivotTable Design tab. The catch is the need to manually refresh the pivot table, the benefit is that when you add new projects they'll be taken care of easily.

Resources