Copy from sheet 1 to sheet 2 every 50th row - excel

I need to copy data from tab1(sheet 1) to tab2(sheet2) every 50 lines. I can get it to do it manually, but when I try and copy the formula down after setting up a few cells it gives me random cells not every 50 like what was in the previous formulas.

If you place this formula in row 1 of any column it will return the proper pattern (2, 52, 102...)
=INDIRECT("A" & 2 + 50*(ROW()-1))
However note that INDIRECT is a volatile formula. This will slow your workbook if you have a lot of calculations and a lot of calls to INDIRECT().

in sheet2!A1, use the following formula, then copy down:
=OFFSET(Sheet1!$A$1,1+(ROW()-1)*50,0,,)

You could use Index and Row to achieve this..
for example the following formula in column B
=INDEX(A:A,(ROW()-1)*50+2,0)
will return back
B1 = A2
B2 = A52
B3 = A102
....

Related

Need help in excel formulas

I have formulas for the top 4 rows formula is as follows row 1) C1= A1+B1 row 2 ) C2=A2+B2 row 3) C3=A3+B3 row 4) C4=C3/C1 and the next row is blank ie C5 post which the same continues 4 rows has formula and the 5th row is blank I have a huge data how to copy the formula below please help
Am struck please someone assist
I have skipped the blanks and copied the first four rows selected the below rows and pasted I need any other alternative either by formula or by copy paste
Cell C1
= IFS(MOD(ROW(),5)=0, "", MOD(ROW(),5)=4, OFFSET(C1, -1, 0)/OFFSET(C1, -3, 0), TRUE, A1+B1)
You can calculate all your data using that formula simply. Just double-click or drag the fill handle of cell C1 down to copy the formula.
The easiest way to do this on a very large scale is to just have ONE and ONLY one formula that applies to all cells, so you are copying it all the way down the sheet one time.
I'd do this by looking at ROW() to get the row number, and more specifically, using MOD(ROW(),5) to get a row index that goes 0-4, with 0 being the blank row.
This formula will look back up to previous rows so you will have to "prime the pump" for the first 3 rows manually:
Cell C1 will be =A1+B1
Cell C2 will be =A2+B2
Cell C3 will be =A3+B3
Cell C4 will be =SWITCH(MOD(ROW(),5),1,A4+B4,2,A4+B4,3,A4+B4,4,C3/C1,0,"")
Then copy this cell, C4, down the entire length of the sheet.
My specific formula assumes there's no headers and the values start in row 1.
If not, you just have to move the formulas to the right SWITCH indexes 0-4.

How to auto fill periodic content in Excel that is not counting up like the rows

Let’s assume I have eight excel cells (A1:A8) with the following content:
=MID(B1,1,2)
=MID(B1,3,2)
=MID(B1,5,2)
=MID(B1,7,2)
=MID(B1,9,2)
=MID(B1,11,2)
=MID(B1,13,2)
=MID(B1,15,2)
Now I mark it and drag it down to the next eight cells. I would like to get the same eight formulas just with B2 instead of B1, but excel is giving me B9 for all cells because 9 is the row number of the first new cell.
How can I tell excel that I want to have B2 in the auto fill (and B3 for the next eight and so on)? It is to much data in order to write it all by hand.
Thank you
Put this in A1 and copy down:
=MID(INDEX(B:B,INT((ROW($ZZ1)-1)/8)+1),MOD(ROW($ZZ1)-1,8)*2+1,2)
It will adjust to the next value in column B every 8 rows and will do the 1,3,5,7,...,15 in the start of the MID. No need for any other formula.
Or, since you stated you have Office 365 put this in A1 and it will spill the results:
=MID(INDEX(B:B,INT(SEQUENCE(COUNTA(B:B)*8,,0)/8)+1),MOD(SEQUENCE(COUNTA(B:B)*8,,0),8)*2+1,2)
If you want to keep your original formula, this will involve 4 steps:
Place the following formula in cell A1
="=MID(" & "B" & ROUNDUP(ROW(B1)/8, 0) & ", " & MOD(ROW(B1)-1,8) * 2 + 1 & ", 2)"
Copy down as far as needed.
Select whole of column A, Copy, Paste Special > Values
Select whole of Column A, Ctrl+H (Replace), Find what "=", Replace with "=", Replace All.
This will create formulas in Column A is in your question.

Copy formula vertical in Excel every third row (skip 2 rows and then take the next one)

I need to copy a formula in excel but only every 3rd row.
Please see the image as reference:
And I need this for about 5000 cells so I ideally would be to drag it down but when I do that excel just references the same row instead the next one from Column A
There is an example on how to do this and skip one cell, but in my case I want to skip 2 cells.
The example is:
=IF(C1="",INDEX($A$2:$A$20,COUNTBLANK($C$1:C1)),"")
and is posted HERE
From cell C1 and drag down:
=IF(INT((ROW()+2)/3)=(ROW()+2)/3,INDIRECT("A"&((ROW()+2)/3)),"")
Or:
=IFERROR(INDIRECT("A"&(ROW()+2)/3),"")
Or non-volatile:
=IF(INT((ROW()+2)/3)=(ROW()+2)/3,INDEX($A$1:$A$10,(ROW()+2)/3),"")
Or another non-volatile:
=IF(MOD((ROW()+2)/3,1)=0,INDEX($A$1:$A$10,(ROW()+2)/3),"")
From cell C2 and drag down:
=IF(INT((ROW()+1)/3)=(ROW()+1)/3,INDIRECT("A"&((ROW()+1)/3)+1),"")
Or:
=IFERROR(INDIRECT("A"&((ROW()+1)/3)+1),"")
Or non-volatile:
=IF(INT((ROW()+1)/3)=(ROW()+1)/3,INDEX($A$1:$A$10,(ROW()+1)/3),"")
Or another non-volatile:
=IF(MOD((ROW()+1)/3,1)=0,INDEX($A$1:$A$10,(ROW()+1)/3),"")
If you statically input the value inside C1 as =A1
And then procceed from C4 with following formula:
=IF(MOD(COUNTBLANK($B$1:$B6),3)=0, INDEX($A$1:$A$18,MATCH(OFFSET(C4, -3, 0), $A$1:$A$18) + 1), "")
Then it will work:

Excel Formula / VBA

I wonder if you can help, I am working on a spread sheet where Column B is populated with data.
What I want to be able to do is to say (using b3 as an example)
If B3 is populated then A2+1. I am using this formula in cell a3:
=IF(B2 > 0, A2 +1)
which gives me the result I want but when I hit a blank cell in B it starts the count over again. so I tried:
=IF(B2 > 0,A2 +1,A1 + 1)
but that counts my blank spaces. I need it to continue the count from the cell above without counting blank spaces. I have also tried applying the formula through pentaho to no avail.
It would be good if the formula actively looked and populated Column A instead of a manual formula having to be copied.
I have also used the COUNTIF function but I don't seem to be able to get it to work.
I hope this makes sense.
With column B like:
Place a starting value in A2 and in A3 enter:
=IF(B2>0,MAX($A$1:A2)+1,"")
and copy down:

Excel - Drag and repeat formula pattern series

I am trying to replicate a pattern of formulas in excel but it's not appearing the way I expect but I'm looking for a solution.
I have the first 2 rows in a table defined and it has 4 columns
The formulas are as follows:
A1 =CONCATENATE(Scores!D11," (",Scores!F11,")")
B1 =Scores!AF11
C1 =Scores!AH11
D1 =Scores!AH15
A2 =CONCATENATE(Scores!D17," (",Scores!F17,")")
B2 =Scores!AF17
C2 =Scores!AH17
D2 =Scores!AH21
I expected when I highlight the cells and dragged down that it would repeat the formula by adding 6 to all the value as shown above.
Is there an easy way to autofill the rows I need as I have to populate over 80 and possible more in the future.
If you use instead in A1:
=CONCATENATE(INDEX(Scores!D:D,11+6*(ROWS($1:1)-1))," (",INDEX(Scores!F:F,11+6*(ROWS($1:1)-1)),")")
then copy down as required, which has the additional benefit of avoiding volatile INDIRECT set-ups.
Regards
You could use Indirect() for the formulas to determine which row they are supposed to go after. Basing the logic off of the current row on which the formula resides:
In A1:
=Concatenate(Indirect("Scores!D" & (11 + (Row()-1)*6)), " (", Indirect("Scores!F" & (11 + (Row()-1)*6)), ")")
In B1:
=Indirect("Scores!AF" & (11 + (Row()-1)*6))
You can see what's happening more clearly in that B1 example. We are dynamically determining the number 11 by using that formula 11 + (Row()-1)*6. For B1 the ROW() returns 0, so the formula is 11+(0-1)*6 or 11. That 11 is concatenated with Scores!AF and then Indirect() returns that back to the formula so it can then look up Scores!AF11 from the workbook and return it's value.
When you copy that formula down to B2 the ROW() returns 2 and the formula then works out to 17, which is your B1 value + 6.
That's a few hops, skips, and jumps to get what you need, but the formula will copy down nicely and save you a lot of typing.

Resources