Sum across multiple sheets with criteria - excel

I am using the formula below in my 'ALL SALES' sheet to consolidate sales from multiple sheets for a corresponding month in each sheet ... So E618 in each tab would be the sales for say Mar-22 and so on for 60 months. This has been working fine as follows
SUM(Intl_Schedules_Start:Intl_Schedules_End!E618)
The sheets all had Mar-22 through Feb-26 in E617 onward so summing it was simple with the above formula..
Now my sheets are more dynamic in that E617 could have Mar-23 onwards for the other 59 months in row 617 in which case when I add the cells E617 from each sheet together I am getting the wrong result as it is adding E618 from one tab which has Mar-22 in E617 and the other tab's E617 is now Mar-23 which of course is incorrect. I have been searching a way to conduct the same calculation but incorporating one criteria of matching the month value in 'ALL SALES' month column (say Mar-22) with the month in each sheets' E617 which could be different... So to summaries.. IN ALL SALES under mar-22 I need to add all the corresponding values in each tab where the month in cell C217 match
There are examples I have found on the web which require a separate list of all the tabs that are being summed but as my sheets could be moved and new ones with different names added it makes for a very time consuming task....
I anyone able to assist me in this?
I hope the image below gives a better idea
TIA

Based on the formula you give within the comments:
=SUM(FILTERXML("<a><b>"&TEXTJOIN("</b><b>",0,Intl_Schedules_Start:Intl_Schedules_End!AR1,Intl_Schedules_Start:Intl_Schedules_End!E618)&"</b></a>","//b[preceding::*["&SHEETS(Intl_Schedules_Start:Intl_Schedules_End!E618)&"]="""&C2&"""]"))
This could be abbreviated using LET if desired.

Related

Data Combining- Need to combine monthly Atttendance entered in different sheet into one

I have monthly attendance on different sheets (almost 4 years).
The employee names might be in a different order or new employees might join. But the employee reg Number is unique.
Future employees will be added as new rows at the end.
Required:
Wanted to combine them all in one sheet and start entering the attendance in the combined sheet from now onwards.
In the Combined Sheet, I want a combo box (Or something else) to select a particular month and if I select that particular month it should hide (or filter not sure whether it is possible to filter horizontally) all the other days.
Need a button or something else to create days for the coming months.
Need to change the formula in Combined Sheet D to G Columns to get the subtotal values.
Please note that values in the COmbined sheet now doest not meet my requirements now.
Thanks in Advance and sorry for too many requests.

Adding values to different cells depending on conditions - Excel

I am not very good with excel formulas, and I would need some help with a process I want to implement:
Simplifying things, I have an excel sheet (sheet n°1) with rows like this:
Company name | Price | Date
On other excel sheet (sheet n°2) I have one row for every company, and in each column there are all 12 months. I would need a formula so every time I add a row in the first sheet, the price I add is automatically added to the corresponding company row and in the corresponding month (based on the date) on sheet 2
I am really lost here, I know how to apply simple formulas, but not this, is there a way to add each value to a different cell depending on some conditions?
I forgot to add, that I would need to sum this values in sheet 2, so every time I add a new value, it is summed to the actual value of the corresponding cell.
I hope my english is not to bad, and thank you in advance!! :)
Use SUMIFS()
=SUMIFS($Q:$Q,$P:$P,$A2,$R:$R,">="&EOMONTH(B$1,-1)+1,$R:$R,"<"&EOMONTH(B$1,0)+1)
One caveat to this the month headers must be an actual date in the month desired. This can be formatted any way you want to display. My cells all contain the 1st of each month as their true dates.

Sum values in different rows if they match

I need some help regarding an issue that I was not able to solve. I tried to figure it out but without reaching my goal. This is what I have:
In sheet 1 I have estimated active customers for a period of time, where columns are months and rows are departments/states:
Sheet 1
Then, in sheet 2, I'm forecasting sales and need excel to return values from sheet 1 depending on which month we are kicking-off for each department:
Sheet 2
Of course, the kick-off month may vary for each department and values from sheet 1 should accommodate according to the selected month on column B in sheet 2.
And within C2:I4 I have used this formula:
=IFERROR(IF(C$1>=$B2,INDEX(Sheet1!$B$2:$F$4,MATCH($A2,Sheet1!$A$2:$A$4,0),MONTH(C$1)-MONTH($B2)+1),""),"")
The formula above actually works great when departments are not repeated in sheet 1 but, what would happen if departments are repeated (as shown in sheet 1) and I have to sum values from the same department and show the result on each cell in sheet 2?
I look forward to your kind help!
Thanks!
Try using SUMIF like this:
=IFERROR(IF(C$1>=$B2,SUMIF(Sheet1!$A$2:$A$4,$A2,INDEX(Sheet1!$B$2:$F$4,0,MONTH(C$1)-MONTH($B2)+1)),""),"")
Please try this formula, designed for your Sheet2!C2 cell.
=IFERROR(SUMIF(INDEX(Rodrigo,,1),$A2,INDEX(Rodrigo,,MONTH(C$1)-MONTH($B2)+1)),"")
In order for this formula to work you should declare a named range comprising of your range Sheet1!A2:F4. My formula calls the range Rodrigo. If you choose another name please change the name in the formula accordingly.
You can exclude zero results by adding a further IF condition to the formula. I would prefer to do that via cell formatting, like 0;0;; where the third semi-colon determines that a zero will not be shown. You can also suppress display of zeros for the entire sheet in the worksheet options.

linking 2 excel files with filters

I have two separate workbooks that I am trying to link: Register and Budget.
The Register file is the source of data and contains only 1 table with columns Date, Category, Credit, Debit. The Budget file is the destination file and has 12 sheets named for each month of the year. Each sheet contains multiple tables named for the Categories. Each table contains columns in which I want to automatically populate from Register one at a time.
So basically, as I manually populate the Register workbook with values in Date, Category, Credit, Debit, I want the Budget workbook to automatically update itself based on these values. The main problem I have is how do I get the Date entered as 01/01/2016 in Register to be recognized as the January sheet in Budget workbook? In addition, I want the correct Category to be recognized in Register as each table's name in Budget. I have changed the table names in Budget based on the category. Finally, I would like the amounts Credit or Debit to be copied from Register into columns in each table of Budget after finding the correct sheet and table in Budget.
Register,
Budget
I looked into Vlookup and it works except for the fact I would have to manually change the formula each time the category or date changes. Sum and Count don't work because I don't want to sum columns nor count data. I simply want to copy and paste from columns Credit or Debit in Register into each table's columns in Budget. I have a feeling I'd have to go into VBA coding to achieve this daunting task which I'm not familiar with.
There are many ways of getting information from other workbooks / sheets etc.
It depends on what you want to do with that information and how it's laid out.
Have a look into VLOOKUP / MATCH / SUMIF / SUMIFS / COUNTIF / COUNTIFS
Which you use will depend on how you want it to work.
If you edit your question to include specifics then I / others can advise further.

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