Summing Cells Upward Until A Blank Cell Is Reached - excel-formula

I'm looking for a formula (not VBA) that sum cells upward until a blank cell is reached in the column on the left. The cells filled with red indicate where I need a formula.
E.g. 355 = 15 + 25 + 30 + 15 + 95 + 45 + 130

If you don't mind putting the results into a different column, one solution would be to calculate the running sum in a third column, making sure to zero it out if a blank cell is found, like so:
The highlighted formula is on cell C2, and can be dragged down on the C column.
=IF(ISBLANK(A1);B2;B2+C1)

Related

Excel count with fixed increment

I have a large table of more than 2000 rows, and 5 columns. The values of these cells are either 1 or 0. For each column I want to be able to count the number of 1s in blocks of 20 rows starting from the first row.
Example: For each column count the number of 1s in the first 20 cells (A1:A20), then in cells 21 to 41 (A21:A41), then from 42 to 62 and so on.
Any help is appreciated.
Many thanks,
egit
I have tried various combination of COUNTIF, ROW and OFFSET but did not work. Spent sometime reading various sites for suggestions but could not find the solution.
=COUNTIF(OFFSET(A1,(ROW()-1)*19,0,20,1),1)
is used to count the number of 1s in blocks of 20 rows for column A.
The OFFSET function starts from the cell A1, which is the first cell of the first block of 20 rows.
Then it uses the ROW() function to determine the current row and subtracts 1 to start counting from the first row.
Next, it multiplies the current row by 19 to offset the range by 19 rows for each row.
This is done because the range is starting from A1, which is the first cell of the first block of 20 rows, so it needs to offset by 19 rows to look at the next block of 20 rows.
The OFFSET function then selects a range of 20 rows starting from that point.
In the first row, the formula will look at cells A1:A20, in the second row it will look at cells A21:A40 and so on.
So when you drag the formula down, it will always look at the next block of 20 rows, regardless of where you drag it.
The COUNTIF function then counts the number of 1s in the selected range and returns the result.

Find cell by your position on cells total in a 2D array

I need find determined cell position based in yout position of range cells total.
Example:
In this table, i have 15 cells,"x" is 8th in these 15 cells and your position is B3. I need find B3 knowing only "x" is 8th cell in this range using a formula.
How to make a formula to find cell this way?
Assuming a 3 column wide area:
=ADDRESS(INT((F1-1)/3)+1,MOD(F1-1,3)+1)
Where F1 has the 8 and the 3s represent the number of columns in the area.

Stop counting when empty row is found

I have a table in which in one cell I display the sum of other cells =SUM(I57: I67). When I copy
the row containing this formula, it is not adapted, is calculated the whole amount for
the next 10 rows.
How to adjust the formula to calculate the sum of the values from cells until empty cell?
So in cell N46 the formula is =SUM (I46:I56)
As I copied the rows 46, 47 and 48 the formula of cell N57 is =SUM (I57:I67)
You can use following array formula:
{=SUM(A1:INDEX(A1:$A$10000,MATCH(TRUE,ISBLANK(A1:$A$10000),0)))}
For an array end address (i.e $A$10000) you can use any address larger than the last cell used.
Array formula after editing is confirmed by pressing ctrl + shift + enter

EXCEL or CALC Question: How to set a max number of character in a cell and automatically skip 2 rows when max number of character is reached?

I'm looking for a way to do this in Excel or Calc:
Set the maximum count of characters per cell of column D <= 70.
If characters count of any cell in column D >= 70, then skip 2 rows.
Explanation:
I want to be able to write text in excel efficiently skipping 2 rows every 70 characters.
Example:
In Excel/Calc sheet cell D1, writing short sentences/strings of 70 characters max.
When cell D1 characters count >= 70, having the cursor automatically skip 2 rows (cells D2 and D3).
Continue writing/inputing the rest of the sentence/string from cell D1 directly into cell D4.
Do the same operations automatically from cell D4 to cell D7, from D7 to D10 etc. for all of column D.
Is this possible in Excel?
Thanks for any help.

How to Autofill cells up to a certain row based on the value in a different cell?

So I have a cell (let's say C3) and I have a column in A.
Let's say that the formula I want to fill for the cells in columnA is A2 = A1 + 1 and so forth.
I have the number 30 in C3.
I want excel to fill exactly 30 cells down column A using that previous formula (A2 = A1 + 1).
If I change the number in C3 to 50, then excel will automatically add 20 more rows in column A following the same pattern.
If I change the number in C3 to 10, excel will automatically delete the rows until the first 10 rows remain.
EDIT TO ADD: OK so I guess I have to use macros. Anyone suggest the VBA code for this?
You can avoid VBA if you know a maximum possible number of rows. Use the following formula in A2 and apply it downward until you've applied through the maximum number of columns.
=IF(ROW()<=$C$3,A1+1,"")
So in reality, you still have a formula in these cells, but you won't see any output until they are supposed to be seen. It's a work-around.

Resources