Summing a variable column - function

I have a Google Sheets that has two columns. Second column is "numbers only", and I need to sum up all the cells in it.
The spreadsheet is updated by several people, and updated frequently (I mean they're adding new cells in the middle), and I need a cell in the bottom to show the sum of all the cells up above.
Something like
=SUM(B1, B[THIS_CELL_NUMBER])

The easiest way is probably to put the sum in a different column, and then sum the whole of column B, as in
=sum(B:B)

It is also possible to keep the result of your sum in the same column. Please look at the answer here: https://webapps.stackexchange.com/a/23837
Basically, you have to use the '$' sign to fix the cell and/or the column.

Related

Change the color of column A, if values match in 3 other columns

I'm looking to change the color of the cell in column A for a row that matches 3 different values across the column. Using Google Sheets, I have tried conditional formatting but can't figure it out.
Example: if column C is today's date, and if column G is also today's date, and if column M has the text "test" in it, then the cell in row A gets pink.
Conditional formatting will work, but I can't figure out how to add multiple required pieces to look for. I tried recording macros too but I'm new at this.
You can add the following custom formula and apply the conditional formatting to column A
=AND($C1=TODAY(),$G1=TODAY(),$M1="test")
I created this test sheet to demonstrate:
https://docs.google.com/spreadsheets/d/1ZJXdINEzy4Gh-OOIpxpiEZSrVtaS-GnFqMbw0FKcxNE/edit?usp=sharing

Make a script to conditionally sum cells

I want to make a small script in google script editor for spreadsheet that sum's cell's according to other cell. Something like:
IF (A2:P2)==Q2{
SUM (A3:P3)}
I want to sum the cells that contains a certain character. Here a example of my question. How can I do it?
You don't need a script for this. You are just describing SUMIF which
Returns a conditional sum across a range.
Using a copy of your sheet I got your desired result with this formula
=sumif(B3:P3,"A",B4:P4)
Then you could use absolute cell references to make it easier to copy this down.
=sumif($B$3:$P$3,"A",B4:P4)
Question has changed
Since you have changed the source sheet you are asking a related but different question. Same as before though... you don't need a script for this. You can use COUNTIFS(). You have two counting criteria. Count if the cell contains a letter and count if the header row contains a number. We break this up into two conditional sets.
=COUNTIFs(B3:P3,Q2,B2:P2,1)
Q2 is the cell that contains "A" and the 1 is the header columns we are counting.
In order to move this down the row by simple drag and drop you still need to use absolute reference in the cells that are not moving. Q2 and the header row specifically.
=COUNTIFs(B3:P3,$Q$2,$B$2:$P$2,1)
To make the sum (row per row) of all the columns that have 'A' in the header, try in Q4:
=ArrayFormula(MMULT(N(IF(B3:P3="A", B4:P11,)) , transpose(N(B3:P3="A"))))
Change 'A' to 'B' etc.. for 'sum of all B'
If you want the result to auto-expand when new rows are added use the formula like this:
=ArrayFormula(IF(LEN(A4:A), MMULT(N(IF(B3:P3="A", B4:P,)) , transpose(N(B3:P3="A"))),))
EDIT: based on new info, I updated the formula to:
=ArrayFormula(MMULT((B2:P2=row(B3:B10)-2)*(B3:P10="A"), TRANSPOSE(COLUMN(B2:P2)^0)))
Example sheet
Of course the SUMIF() proposed by Matt will equally work (and is definitely a lot simpler). To drag the formula down, use the dollar signs to 'freeze' the header row, e.g: sumif($B$3:$P$3,"A",B4:P4)).

Add "COUNT" column in SSRS in place of details rows

Apologies for this very newb-like question. I have some detail data that I want to group... I have added three group by columns (LOB, Event Classification, Assigned) to my table and want to add a third (Count) that counts the number of rows in the third (Assigned) group. At the moment I do this simply by adding a CountRows() column within the last (inner most) group. This is all I want to show. But I am forced to add a details column that I do not need (in this case I have "Amount"). Please see figure below:
Basically, I like what I have, except that I don't need that last "Amount" column. If I hide it, the row heights stay the same (i.e., their height is determined by the number of rows in the hidden column). I'm guessing I'm missing something pretty fundamental here. Any ideas?
From http://consulting.risualblogs.com/blog/2013/06/28/tablix-body-must-contain-at-least-one-column-ssrs/ I found:
Right click the last column, ‘Column Visibility’, ‘Hide’
2: On the ‘Row Groups’ or ‘Column Groups’, right click the ‘Details’ grouping and press delete, but only delete the grouping, not the associated rows and just delete the data in the last column.
It sounds like you need to place your values in the header of the last group defined which in your case is "Assigned". And remove the detail column. This should allow you to aggregate your values outward. The Count column would be a second group header for the Assigned group.

How can I merge 5 lines in the last column?

In all the columns the information is different in each line, but in the last column, the information is the same...
Can I somehow merge all the cells in the last column and just write 30 dollars once?
http://jsbin.com/tifuhute/32
You need to assign a rowspan to the last column of the first row of the table.
http://jsbin.com/tifuhute/33
You can use rowspan attribute to do this.
Please go through :
http://www.htmlcodetutorial.com/tables/index_famsupp_30.html
http://www.w3schools.com/tags/att_td_rowspan.asp

Multiple tables/tablix depending on query

Is it possible to display dynamic number of tablix(es) in a report?
That is, if we do not know the number of tables/tablixes to be displayed in advance.
The requirement is that all the output tables will have exact same structure (row and column lables, groupings, etc.).
If you are using data from a single data source, you could achieve this result by using a single tablix, having the highest grouping on the item(s) you want to use to break up the tablix and including a page break as part of that grouping.
For now, I found a way to solve it. Created a static row within the top group and set set its RepeatOnNewPaAge=true. Remove the borders, so that it looks like a separate text above the table.
This way, it prints the latest group info at the top (because it is part of the group) and also gets displayed on every page, because it is statc. Cool huh? :-)