Excel, nest counta function into range of sum function - excel

I want to expand range of sum when new cells are added in down.
My first try was nesting counta function into range of sum function but it didn't work.
=SUM(I4&":I"&COUNTA(I:I))
Anyone has any idea about how to do it?

The shown solution does not work when there is an empty cell in the SUM range
It would be safer to just use:
=SUM(I:Ï)
to summarize the entire column.
If summing the entire column isn't possible I suggest to make an Excel Table column out of your data.
Excel Tables adjust automatically when new data is added. This is best practice.

Related

SUMIFS with horizontal range and column header Excel formulas

Here is a picture to visualize what I want:
I'm basically trying to sum each row separately based on the value in column A.
I tried with:
=SUMIFS(A1:D4,A1:A4,F1)
And obtain #Num
Because it's based on header values.
I tried to transpose the data range also without luck.
Is there a smart way of doing this insted of summing a row at a time?
I'm trying to avoid range command, where ctrl+shift+enter must be used to obtain a result.
In F2 either try:
=SUMPRODUCT(($A:$A=F1)*$B:$D)
Or:
=SUMPRODUCT(($A1:$A4=F1)*$B1:$D4)
Where the specific range references would impact your performance way less! Drag right.

Need excel average formula for a dynamic range

This is what my table looks like:
Please note that I cannot change the position of any data here. This is a table that will continuously expand as I add new columns to the right and new rows at the bottom.
I need a formula in Column A that will calculate the average of all data in the same row as where the formula is and the formula has to autoupdate whenever I add new columns to the right of the last column. For example, in cell A64 is the formula that will average C64 to E64. when I add new data in F64, I want A64 to autoupdate to include that new cell in the computation.
I tried
=AVERAGE(INDIRECT("C64:"&ADDRESS(ROW(),COLUMN()+4)))
but it did not autoupdate when I added new data in F64. I am not an excel expert and I mostly learn by googling, but this one is taking me forever. Please help.
This is where OFFSET and COUNTA are your friends, In A2 and fill down:
=AGGREGATE(1,6,OFFSET(C2,,,1,COUNTA(C2:XFD2)))
I have used AGGREGATE function with argument 1 for Average and argument 6 to ignore error values in the range. COUNTA resizes the array from C2 to the end of the populated area (allowing for error values).
You can also use INDEX with COUNTA
=AGGREGATE(1,6,$C$2:INDEX(C2:XFD2,COUNTA(C2:XFD2)))
Or INDEX with MATCH. In the example below, I have reduced the column end point to AA, rather than XFD (which is the last column in 2016). If you know a realistic number of columns that will ever be filled you can use that as your end point reference to reduce the amount of work your dynamic formulas are doing.
=AGGREGATE(1,6,$C$2:INDEX(C2:AA2,MATCH(99^99,2:2)))

How to make a VLOOKUP formula conditional in Excel?

I've got a large Excel workbook with multiple worksheets and copious amounts of data. Every third sheet is an amalgam of the previous two sets. I've set up the following formula to pull the data from each worksheet, add it together, and present it in the third worksheet:
=SUM(VLOOKUP($A7,'worksheet 1'!$A:$F,2,FALSE)+VLOOKUP($A7,'worksheet 2'!$A:$F,2,FALSE))
This works as expected, unless the column A value is in one of the source worksheets but not the other. Then, I get the #N/A error with "Value not available."
What I want to do is make it so that, if the column A value is not present in the first worksheet, excel ignores that VLOOKUP request and simply pulls in the data from the second worksheet (and vice-versa for a value in the #2 but not #1).
If VLOOKUP isn't the appropriate tool to use, I can change it. I had an example sheet that I used to build this query, and that's how they put it together.
I am not an Excel expert and I've never used Access, so I'm learning as I go. Any assistance is appreciated!
Since you are using numbers, you could actually use multiple sumif statements.
I would suggest something like:
=SUM(SUMIF('worksheet 1'!$A:$A,$A7,'worksheet 1'!$B:$B), SUMIF('worksheet 2'!$A:$A,$A7,'worksheet 2'!$B:$B))
SUMIF is faster, won't look in the entire range, and if it does not find the value in A7, it will simply return 0.
I hope this helps.
UPDATE
Simple example. Say we have 2 sheets with a total column and we would like to get the value of that total cell:
you could sum 2 VLOOKUP forumale, or you could use SUMIF as follows:
=SUM(SUMIF(Sheet1!$A:$A,$A$7,Sheet1!$B:$B),SUMIF(Sheet2!$A:$A,$A$7,Sheet2!$B:$B))
The above is simply saying: Look for the value in cell A7 in the range $A:$A in sheet1 and return what's in the same row in the range $B:$B, and do the same in sheet2, then sum them both.
Note that SUMIF will actually sum all the resutls in a range, so if you have 2 totals in Sheet1!$A:$A then it will sum them both up. In a way this is the opposite of what VLOOKUP will do: it will stop once the first row containing the value is found. SUMIF won't stop.
The desired result in the example above is 208 and that's what you shall get.

How to SUM only to a specific row in excel

I would like to SUM() to a specific but variable row in excel.
I've tried dynamic ranges but didn't have much luck. I want to be able to insert rows in this range and have sum take account of the newly inserted values.
For example before inserting a new row the formula might look like this:
=SUM(A2:A3)
And after insertion the formula should look like this:
=SUM(A3:A4)
Any ideas?
I solved it by extending my range one row up:
=SUM(A1:A3)
Then, by inserting a row at A2 the range does indeed extend automatically.

Excel SUM dynamic range returned from database

I am new to excel and I am trying to write an excel formula where I sum all the values from a single column. The data is returned from a .net application so I am using a template file and each column as a suffix which is %%=sso.qty for example. So its only when a report is run through the application that there is actual data in each column.
I want a formula which will dynamically add all values in a column regardless of cell range. So if my suffix is in cell K10 how would the formula know to adjust the range based on how many rows of data there is?
Does anyone know a good way of doing this?
Assuming the formula will be placed in a different column, you can SUM an entire column by specifying the column without a row reference, like this:
=SUM(K:K)

Resources