SUMIFS across a range of sheets - excel

I'm building an excel home finances/budget workbook. I would like to keep the transactions for each account on separate sheets with my budget sheet separate from those. I was looking for a way to sum the categories without hard-coding the names of the sheets used. I setup the sheets as follows.
Budget - Start - Account1 - Account2 - End
I have more accounts to add once i get it working. This is all prototyping to make sure I can do what I want.
I found I can do the following to sum everything on all sheets between Start and End (as long as those are blank).
=SUM(Start:End!B1:B10)
What I can't get working is a SUMIFS
=SUMIFS(Start:End!B1:B10,Start:End!A1:A10,"Count")
In column A a cell that has "Count" or "Don't". These will eventually become categories. The above gives me a "#VALUE" error. I wasn't able to get SUMIF to work either. I may add other conditions down the road.
Am I doing something wrong? Is there an easy way to do something like this?

I got it to work by making a Range E2:E4 containing the names of the sheets, the first being "Start" and the last being "End".
I also have a criteria box E7 with value "Count"
Start
I've populated columns A1:A10 with either "Count" or "Don't".
I've populated columns B1:B10 with numbers.
Sheet2(left) and End(right)
Then I used this formula to return the desired result:
=SUMPRODUCT(SUMIF(INDIRECT("'"&E2:E4&"'!A1:A10"),E7,INDIRECT("'"&E2:E4&"'!B1:B10")))
Don't know if that helps you but it does produce the desired results with the extra work of writing up a sheet list and a criteria list.

Related

Creating a dynamic formula so it takes a number within a cell as the row number

I have a master sheet, that holds all data in a matrix form (Criteria along the top i.e. Level 0,1,2,3,4,5) and criteria along the side (e.g. Organisation, Governance, Finance, Strategy). Within the master sheet, there is data that matches these criteria, and therefore plotted in the matrix. However, there is not data for all criteria, and therefore, there are blanks.
I would like to use this master sheet as the data source, and use the same format, but i would like to divide each section (I.e. Organisation, Governance, Finance, Strategy) into its own sheet and display the data for that criteria only.
I will also want to make this dynamic to ensure that if the criteria was changed in the future, the sheets would still work.
Therefore, I am using the following formula
=(UNIQUE(FILTER('MasterSheetGrid'!D8:I8,'MasterSheetGrid'!D8:I8<>"")))
This formula works well, however the row numbers are not dynamic and the formula may break in future. Therefore, i am wanting to use the following formula
=MATCH($C6,'MasterSheetGrid'!$C:$C,0)
to search for the row number, and then use this formula or output as the numerical row number in the formula above, but i receive an error each time.
>=(UNIQUE(FILTER('MasterSheetGrid'!D" &(MATCH($C8,'MasterSheetGrid'!$C:$C,0)& ":I" &(MATCH($C8,'MasterSheetGrid'!$C:$C,0)& ",'MasterSheetGrid'!D" &(MATCH($C8,'MasterSheetGrid'!$C:$C,0)& ":I" &(MATCH($C8,'MasterSheetGrid'!$C:$C,0)& "<>"")))
Can anyone help?
You can use:
INDEX('MasterSheetGrid'!D:I,MATCH($C6,'MasterSheetGrid'!$C:$C,0),0)
to get the desired row. So then something like:
=LET(DataRange,INDEX('MasterSheetGrid'!D:I,MATCH($C6,'MasterSheetGrid'!$C:$C,0),0),UNIQUE(FILTER(DataRange,dataRange<>""),TRUE))

Get the name of column header and export to different excel worksheet

I have to work with different checklists in different Excel workbooks in order to organize the progress.
I made a summary where I set a counter in the number of items that I am missing for different workbooks using the formula shown here:
=SUM(LEN(XXX)-LEN(SUBSTITUTE(XXX,"pending","")))/LEN("pending")
However, in order to not have to consult to each of the workbooks to find out which items are pending to complete, I am requesting some guidance to understand if it's possible to say that:
If item in cell is pending, extract the name to a different cell in my summary.
Here's an example workbook:
Summary example
Thank you
I have Comment and a partial solution.
I am ignoring the the cross workbook issues for simplicity.
Get the basics working and deal with that later.
In the formula
=SUM(LEN(XXX)-LEN(SUBSTITUTE(XXX,"pending","")))/LEN("pending")
the sum function is not used correctly. Sum add up all the numbers in
a list and/or range of cells. You have a expression. It will work but is not needed.
=(LEN(XXX)-LEN(SUBSTITUTE(XXX,"pending","")))/LEN("pending")
should work.
As for the sum of the item tagged with "pending" that can be done with a couple of extra rows that would be hidden in your final sheet.
In the sample sheet. Rows 4 and 5 are intermidate calculation rows that will be hidden for final display.
Row 4 has the same relative formula :
=if(B3="pending",B2,"")
for all cells. It copies the data in row 2 only if row 3 has the word "pending".
The objective is to concatenate all of the non blank details
into one cell. I chose a solution that would with Excel 2003+. (2019 could use TextJoin() as an alternative solution)
in row 5 Cell b5 has
=if(len(B4)>0,B4,"")
Starting with C5 the rest have the relative formula
=if(len(B5)>0,if(len(C4)>0,B5&"+"&C4,B5),C4)
This progressively concatenates the cells together ignoring blank cells.
F5 has the answer needed
C8 has the
=COUNTif(B3:F3,"pending")
To count the number missing
and D8 just points as F5 to pick up the results.
For presentation purposes hide rows 4 and 5.

Excel: get row from criteria

I have one Excel file with two sheets. The first sheets contains data (Events with date and more information in columns), and in the second sheet I want to display Events from one sort of category and if they are in the future.
I tried various aproaches, but could't work it out at all. First I tried to transose the data from the first sheet, which made me realize was a bad approach, then I tried Vlookup which seems to be the best approach, but even after 6 tutorials I couldn't make it work to get the whole row, where the Category is "Walk Up".
To display a list with all "Walk Up" Events would be one first good step. After that I will have to check if the date for the events has been expired would be the second.
Criteria:
Event has EventType: "Walk Up"
Event has date > today
==> Get all Events matching the criteria
Any help or suggestions are much appreciated!
Daniel
let's assume you have a data setup like this:
[
I think the easiest way to achieve what you want is to create a helper column. In this example, we'll use column D. We'll also setup the criteria you want to pull by having those as sort of criteria information over your result set. It'll end up looking this this:
[
So to get it to look like that, I did the following:
Put this formula in your helper column (in this case cell D2 and copied down): =IF(AND(A2=$G$1,B2>$G$2),MAX(D$1:D1)+1,"")
Put this formula in cell F5 and copy down: =IF(ROW(F1)>MAX(D:D),"",$G$1)
Put this formula in cell G5 and copy over and down: =IF($F5="","",INDEX($A:$C,MATCH(ROW(G1),$D:$D,0),MATCH(G$4,$1:$1,0)))
At this point you can hide the helper column if preferred, and if you want your results on a different sheet, just cut and paste to a different sheet (in this case you'd cut columns F:H).

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.

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.

Resources