Skipping Rows in Excel Function

ACrelia

New Member
Joined
Feb 13, 2017
Messages
3
I am trying to paste data from Sheet 1 onto Sheet 2 and have 5 cells skipped on Sheet 2. I need to drag the formula down so that:

Sheet 1, Cell B2 = Sheet 2, Cell A2
Sheet 1, Cell B3 = Sheet 2, Cell A7
Sheet 1, Cell B4 = Sheet 2, Cell A12
And so forth...

Then in Column B on Sheet 2, I need to drag a formula down so that:
Sheet 1, Cell C2 = Sheet 2, Cell B2
Sheet 1, Cell C3 = Sheet 2, Cell B7
Sheet 1, Cell C4 = Sheet 2, Cell B12
And so forth...

I have tried using formulas found in other forum posts to no avail. Any help would be greatly appreciated!

Thanks!!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the forum.

In Sheet1, B2:

=OFFSET(Sheet2!A2,(ROW()-2)*5,0)

copy that to C2, and copy both columns down as far as necessary.
 
Last edited:
Upvote 0
Which one (or both?)

The one you posted :) (I couldn't get the first one that posted to work)

I did run into one problem though... On a new sheet I need to continue the formula to leave off from where I left on Sheet 2. For Example on Sheet 3 I need:

Sheet 1, Cell A22 = Sheet 3, Cell A2
Sheet 1, Cell A23 = Sheet 3, Cell A7
Sheet 1, Cell A24 = Sheet 3, Cell A12

Currently, when I input the formula, it starts at A2 again.
 
Upvote 0
I believe I misread your question, which is why my post didn't work. I'm glad Joe was on the ball.
 
Upvote 0
I did run into one problem though... On a new sheet I need to continue the formula to leave off from where I left on Sheet 2. For Example on Sheet 3 I need:

Sheet 1, Cell A22 = Sheet 3, Cell A2
Sheet 1, Cell A23 = Sheet 3, Cell A7
Sheet 1, Cell A24 = Sheet 3, Cell A12

Currently, when I input the formula, it starts at A2 again.
Let's break down how the formula I wrote for you works.
First, let's start off with the outside.
Code:
[COLOR=#ff0000]=IF(MOD(ROW(),5)=2[/COLOR],INDIRECT("Sheet1!B" & (ROW()+8)/5),[COLOR=#ff0000]""[/COLOR])
You wanted the formula to appear in every 5th row, starting at row 2.
The key here is the MOD and ROW() functions.
If you use the ROW() function with no arguments, it simply returns the row number the formula is located in (try putting =ROW() in any cell and copy down).
And the MOD function simply returns the remainder when dividing two numbers (see: https://www.techonthenet.com/excel/formulas/mod.php)

So, we want the formula to appear in any row number that when we divide the row by 5, the remainder is 2. So, that ID formula checks to see if the remainder is two. If it is, it evaluates the inside part. If it is not, it returns nothing ("").
That takes care of the blank rows.

Now, whenever we want to dynamically build a range reference in Excel, we have to use the INDIRECT function so that Excel knows we are talking about a range reference, and not a literal text string. So if we want to return the value from Sheet1, cell B2, if we wrote that reference dynamically, it would look like:
=Sheet1!B2
However, we want to build a formula to return this based on the row number that the formula is in. So we need to come up with that formula. We know that the "Sheet1!B" part won't change, just the row number. That is where this part comes in:
(ROW()+8)/5
Because for every 5 rows we go down, we want our row number to increase by 1, we divide by 5.
(If we had the situation where for every one row we went down, we want our row number reference to increase by 5, we would multiple by 5.
So we are always going to multiply/divide by the number of rows we are "jumping".
The last part, the +8, is just a number that you plug in to get it to work, and is dependent on which row you are starting on. So you can back into that number.

So, when we plug in a 2 for ROW(), we want to return 2.
When we plug in a 3 for ROW(), we want to return 3.
When we plug in a 4 for ROW(), we want to return 4.
etc.

So let's try the first one:
(ROW()+?)/5=2
(2+?)/5=2
2+?=10
?=8

If we plug the 8 into the next one, we get:
(7+8)/5
15/5
3

And the next:
(12+8)/5
20/5
4

So we can see that it works!

So, the way I usually approach this, is go to the cell that I want return my value in via formula, and work on first just getting the row part right:
=(ROW()+8)/5
If I have it working right, when I copy it down rows, it should return the row reference number I need.
Then, we just build around that.

Hope that makes sense!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top