Sum up values from different worksheets - excel-formula

I'm building the budget template in Excel. In the Summary sheet, I want to sum columns from different worksheets by the corresponding cell.
enter image description here
In my way, I get all sheet names (by VBA code, it will automatically update when creating new worksheets), then use TEXTJOIN to have all reference cells I want in a text. It looks like this: Sheet1!$B$2,Sheet2!$B$2,Sheet3!$B$2,Sheet4!$B$2,Sheet5!$B$2,Sheet6!$B$2,Sheet7!$B$2
I guess we can have some way to put that text in SUM function in Excel to sum up all reference cells value, but I haven't found how to do that yet.
If anyone can have a look and give me a solution, it's much appreciated.
Thank you as always

As I understood the question you can do like this in reference cell:
=SUM(Sheet1:Sheet7!C2)
=SUM(Sheet1:Sheet7!C3)
=SUM(Sheet1:Sheet7!C3)
=SUM(Sheet1:Sheet7!C5)
=SUM(Sheet1:Sheet7!C6)
--------

Related

Transforming SUMIFS to individual cell references

I am new here, so apologies if this has been answered before.
I am trying to create a VBA script to transform cells using SUMIFS to pull data to individual cell references.
Ie. if I pull a value from another tab using a SUMIFS function, I want the output to be exactly the cell it is referenced (=cell).
Specifically, I am thinking of:
Read all cells in a sheet,
Identify which cells pull value with a SUMIFS function
Get the cell reference from which the data matching the SUMIFS is sourced
Convert the SUMIFS formula to the matching cell reference (ie. =A35)
I am trying to see individual codes for this, but not sure where to begin with, or if this has been previously solved.
Any thoughts will be highly appreciated!
Thank you!
Tried the above steps

Excel Sumifs with multiple arrays referenced on another cell

I have a formula that sums one column based on a criteria from another column. This formula works fine:
=SUM(SUMIFS(sheet1!C:C,sheet1!A:A,{1, 7}))
However, i need to be able to use a cell reference which will contain the {1, 7}
So the formula will look like this:
=SUM(SUMIFS(sheet1!C:C,sheet1!A:A,M2))
But this returns a zero, when evaluting the formula it pulls the contents from the cell but wraps it in "" which i think is where the issue is happening.
I've tried adding formula to remove the quotes, and trying to pull the contents differently, but still the same.
Any help would be greatly appreciated.
Figured out a way round this.
I created a named range called condition, and assigned =Evaluate($M2).
Then I used this formula =SUMPRODUCT(SUMIFS(sheet1!C:C,sheet1!A:A,Condition))
This picks up all numbers used in M2, and works on all rows below with the Evaluate formula following.
Thank you to everyone that assisted with this.
This link helped aswell: Excel SUM of SUMIF/SUMIFS with dynamic multiple criteria

How can I make a criteria in an excel forumla reference text in another cell?

I am using a SUMIFs formula in excel. One of my criteria consists of text, but the text will vary for every row I am applying this formula too. Rather than typing out that text for each column, I'd like to find a way to include in my formula the reference for where that text comes from, and have excel grab it for each row.
This picture shows what I am currently working with.
The last term in the formula is "BT-107-141-1". That is also the value of A2 in this sheet. Rather than typing "BT-107-141-1" (and doing the same thing for every row I have), can I direct excel to use whatever value is in A2 as the criteria in this formula?
I was trying to use INDIRECT, but couldn't get it to work. Something like "VALUE($A2)" might work?
Please let me know if you have any questions, I would really appreciate some help! Thanks.

Look up multiple values in a list and sort them in a new sheet

I have a data sheet that contains 9 columns corresponding to a name. But the names are repeated. So I want to create new sheets for all names and filter their data from the data sheet. The sheets must be updated when any changes are made on the data sheet.
I tried VLOOKUP but had some various problems, and it didn't work well for me. I've found a way that may help, but it's prepared for Excel. ( https://fiveminutelessons.com/learn-microsoft-excel/use-index-lookup-multiple-values-list )
In OpenOffice ROW(1:1) doesn't give a result. Dragging as an array also doesn't change the cells in the formula. So are there any alternative ways to solve this problem? (OpenOffice solutions are preferred).
The example from the link in the question almost works in LibreOffice. To fix it, instead of ROW(1:1), use ROW($A$1:$A$6).
I am not sure what ROW(1:1) does in Excel, and I could not find an explanation online. In Calc, ROW($A$1:$A$6) returns an array of 1 column x 6 rows: {1;2;3;4;5;6}.
So here is the full formula using the example.
=IF(ISERROR(INDEX($A$2:$C$7,SMALL(IF($A$2:$A$7=$A$9,ROW($A$2:$A$7)),ROW($A$1:$A$6))-1,3)),"",INDEX($A$2:$C$7,SMALL(IF($A$2:$A$7=$A$9,ROW($A$2:$A$7)),ROW($A$1:$A$6))-1,3))
Be sure to enter it as an array formula with Ctrl+Shift+Enter

Indirect call of a column from different sheet

I know how to use the indirect formula in a sheet itself.
=INDIRECT(CHAR(ROW(A5))&ROW(A5))
However, I am having hard time manipulating this to find a formula from different sheet called 'sheet1'
I am trying to retrieve value in B3 of Sheet1 using indirect formula. Any help is appreciated.
Please note, going forward (I plan to drag this formula down) I plan to manipulate rows and columns so I do want both of them (rows and columns) as variable values.
Eg: NOT indirect('Sheet1'!B3) but rather something like indirect('Sheet1!'&char(row(a5))...etc) which is not working for me.
Thanks for the help!
=INDIRECT(CHAR(ROW(A5))&ROW(A5)) just returns #REF
do not use something like CHAR() to build a "A1" address. Better use R1C1:
=INDIRECT("'Sheet1'!R3C2",0)
to make the row dragable:
=INDIRECT("'Sheet1'!R"&ROW()&"C2",0)
or to fit the columns:
=INDIRECT("'Sheet1'!R3C"&COLUMN(),0)
or for both:
=INDIRECT("'Sheet1'!R"&ROW()&"C"&COLUMN(),0)

Resources