Excel, how to increment row number for the SUM function? - excel

I have a Excel spreadsheet with original data in the range A1:A100
I want cell B1 to be the sum of A1:A5, B2 = sum(A6:A10), B3 = sum(A11:A15) and so on. What formula can I use for cell B1, that allow me to copy it to others B cells to achieve the above?
Thanks and Regards,
Nhan.

=SUM(OFFSET(A1,4*(ROW(A1)-1),,5))

Related

Sum of two cells in the same column with a lag of n cells

I have a simple question on Excel for which I cannot easily find an answer on the web.
Let us assume that I want to sum the cell A1 and the cell AN where N is a number in a given cell.
How can I easily use the sum function to achieve this ?
Example :
If n=2, I sum A1 and A3.
If n=10, I sum A1 and A11, etc. where the number n is the cell, let's say, B1.
Thanks for your help !
Use this formula
=sum(A1, indirect("A"&(B1+1)))
I would use the non volatile INDEX:
=SUM(A1,INDEX(A:A,B1))
Where B1 is the cell in which N is placed.
IF you meant to sum all cells between A1 and AN then we would use:
=SUM(A1:INDEX(A:A,B1))
Unlike Indirect this formula is not Volatile and will only recalculate when the data changes.

how do get number separately

I have number from 1 to 100 in column A1 to A100.
I am trying to achieve two results from data.
I want separately 1,2,3,4,5,6,7,8,9 and another one 10,20,30,40,50,60,70,80,90,100
Please help me
Maybe, in B1:
=1*(LEN(A1)=1)+2*(RIGHT(A1)="0")
double-click the fill handle and sort A:B on ColumnB.
This question is a bit vague. If you are looking to count by 10s, try adding a 10 in cell B1 and then adding the formula =B1+10 in cell B2. You can drag that formula down to count by 10s.
Let's say we want in column B "0, 1,2,3,4,5,6,7,8,9" and in column C "0, 10,20,30,40,50,60,70,80,90,100", put:
- =MOD(A1,10) as formula for the cell B1
- =INT(A1/10)*10 as formula for the cell C1
and then copy them to rest of the rows.

Insert a value to a cell in excel using formula in another cell

I need to insert a value to a cell in excel using formula in another cell.
Say
A1 = "Test"
B1 = formula to insert A1 to C1
C1 = A1
Can I write a formula in B1 to insert value in C1?
I don't need any formulas in C1.
If Yes, What should be the formula?
If there it is next to the cell AND has no value in B2, it is possible, otherwise it is not.
Use Split()
Split(CONCATENATE("Text for B1#Sperator$$",A1),"#Sperator$$",FALSE)
It really depends.
EDIT
Out dated. Only works in google sheets.
Without using VBA or formulas in column C you can't achieve this.
A simple solution using formulas:
In cell C1, paste the following formula and drag it down:
=IF(B1=1;A1;"")
So if the content of cell B1 is equal to 1, your cell at column C will display the respective value of the same row at column A.

Excel formula for finding a column match and writing to that specific adjacent row

http://oi60.tinypic.com/30mvcli.jpg
So basically I want to check all values in column B against all values in column A. If there is a match I want column C to write the value of column in the corresponding row that A is on (as shown in the picture).
Not sure which forumla(s) I need to use to do this. Thanks.
Todd, I think a simple if statement should work here.
=IF(A1=B1,A1,"")
The above formula will copy the data from A1 into C1 only if A1 is equal to B1.
Enter this formula into C1 and drag it down for as many rows as you need (Excel will change the 1s to 2s etc). Let me know if this works for you :)
=IF(ISNUMBER(MATCH(A1, B:B, 0)), A1, "")
Put this to C1. Drag down for as many rows as you need.
In C1 try,
=if(countif(b:b, a1), a1, "")
      
Fill down as necessary.

Formula over multiple sheets with condition

I have five sheets named Sheet1, Sheet2, ..., Sheet5. I want to sum up the values from cell A2 to cell A10 over all these sheets. But I only want to include a sheet in this sum if its value in cell A1 is equal to 3. What is the formula I require to achieve this?
This code should be the end all be all on your question.
It checks each sheet and adds all the numbers (from A2 to A10) from the sheets inwhich A1 = 3 and excludes the sheets that does not meet the requirement.
I tested it.
=SUM(IF(sheet1!A1=3, SUM(sheet1!A2:A10), 0),IF(sheet2!A1=3, SUM(sheet2!A2:A10), 0),IF(sheet3!A1=3, SUM(sheet3!A2:A10), 0),IF(sheet4!A1=3, SUM(sheet4!A2:A10), 0),IF(sheet1!A5=3, SUM(sheet5!A2:A10), 0))
Try this:
=SUM(IF(N(INDIRECT("'Sheet"&{1,2,3,4,5}&"'!A1"))=3,SUMIF(INDIRECT("'Sheet"&{1,2,3,4,5}&"'!A2:A10"),">0")))
Regards

Resources