Copy Formula Down

nacskins

New Member
Joined
Sep 20, 2013
Messages
46
I have searched and i am unable to find an answer, is there a way to copy a formula down a column and have it auto skip every other ref cell. Example below. Thanks

=CONCATENATE(A2, ",")
=CONCATENATE(A4, ",")
 
OK, then this version should do it.
Put this in cell B2 and copy down:
Excel Formula:
=CONCATENATE(INDIRECT("A" & (ROW()-1)*2),",")
Thanks, looks like that will work.

Any suggestions for the Column C and D to do the same


=SUBSTITUTE(A2, "2TK", "MDCENB00") = Column C, C2, C3 and so on wanting to pull from A2, A4, A6 and so on.

Then Column D

=SUBSTITUTE(A3, ":", "") i need to pull from A3, A5, A7 and so on. and put the formula in D2, D3, D4......
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Thanks, looks like that will work.

Any suggestions for the Column C and D to do the same


=SUBSTITUTE(A2, "2TK", "MDCENB00") = Column C, C2, C3 and so on wanting to pull from A2, A4, A6 and so on.

Then Column D

=SUBSTITUTE(A3, ":", "") i need to pull from A3, A5, A7 and so on. and put the formula in D2, D3, D4......
The logic should be exactly the same, so you should be able to incorporate the logic I can you on these other ones.

I will explain to you the logic.
What are trying to do is dynamically build the cell references (i.e. "A2", "A4", etc).
The problem is if we use formulas to build those cell references, they are treated as "literal text" and not cell references.
We correct that problem by wrapping it in an INDIRECT function, which tells Excel we are building a range reference, not a string.

So let's break it down.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)
We want to build a formula that returns "A2" when placed in cell "B2", returns "A4" when placed in cell "B3", etc.
So, the way to do this is to first build the "inner" part of the indirect formula (just return the string so you can see what it is doing).

We know that it will always be column "A", so we can hard-code that part.
The ROW() function will return the row number that the formula is placed in.
So, if we enter the following formula in cell B2:
="A" & ROW()
it will return "A2" (it copied down, it will return "A3", "A4", etc).
So it doesn't exactly work when copied down, but we will come back to that later.

Because we want the row value to increment by 2 for every row we copy the formula down, we need to multiply the ROW() function by 2, i.e.
="A" & ROW()*2
However, then that will put "A4" in cell B2, "A6" in cell B3, etc.
So we need to adjust that by subtracing 1 from the ROW() part, i.e.
="A" & (ROW()-1)*2
Now, this returns what we want ("A2" in cell B2, "A4" in cell B3, etc).

Now that we have the calculation working the way we need, we simply wrap it in the INDIRECT function to make it a range reference, i.e.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)

So the way that I usually approach this is to first build the inner part of the indirect function to return the values you need for each cell (like I showed above).
Then, once you have that working well, just wrap it in the INDIRECT function, and you are good to go!

Give it a shot with your other formulas and see how you do (you will learn a lot more trying this yourself than having me do it for you again).
The first one should be very easy, as it is practically the exact same calculation, just a different column reference.

Just note that the INDIRECT function should replace your current cell reference. So the structure will be like:
=SUBSTITUTE(INDIRECT(...), "2TK", "MDCENB00")
 
Upvote 0
The logic should be exactly the same, so you should be able to incorporate the logic I can you on these other ones.

I will explain to you the logic.
What are trying to do is dynamically build the cell references (i.e. "A2", "A4", etc).
The problem is if we use formulas to build those cell references, they are treated as "literal text" and not cell references.
We correct that problem by wrapping it in an INDIRECT function, which tells Excel we are building a range reference, not a string.

So let's break it down.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)
We want to build a formula that returns "A2" when placed in cell "B2", returns "A4" when placed in cell "B3", etc.
So, the way to do this is to first build the "inner" part of the indirect formula (just return the string so you can see what it is doing).

We know that it will always be column "A", so we can hard-code that part.
The ROW() function will return the row number that the formula is placed in.
So, if we enter the following formula in cell B2:
="A" & ROW()
it will return "A2" (it copied down, it will return "A3", "A4", etc).
So it doesn't exactly work when copied down, but we will come back to that later.

Because we want the row value to increment by 2 for every row we copy the formula down, we need to multiply the ROW() function by 2, i.e.
="A" & ROW()*2
However, then that will put "A4" in cell B2, "A6" in cell B3, etc.
So we need to adjust that by subtracing 1 from the ROW() part, i.e.
="A" & (ROW()-1)*2
Now, this returns what we want ("A2" in cell B2, "A4" in cell B3, etc).

Now that we have the calculation working the way we need, we simply wrap it in the INDIRECT function to make it a range reference, i.e.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)

So the way that I usually approach this is to first build the inner part of the indirect function to return the values you need for each cell (like I showed above).
Then, once you have that working well, just wrap it in the INDIRECT function, and you are good to go!

Give it a shot with your other formulas and see how you do (you will learn a lot more trying this yourself than having me do it for you again).
The first one should be very easy, as it is practically the exact same calculation, just a different column reference.

Just note that the INDIRECT function should replace your current cell reference. So the structure will be like:
=SUBSTITUTE(INDIRECT(...), "2TK", "MDCENB00")
Thank you!!!!!!!
 
Upvote 0
You are welcome.

If you run into any issues implementing this logic on your other two formulas, post back here, and show me the formula you tried, and I can help you adjust it.
 
Upvote 0
The logic should be exactly the same, so you should be able to incorporate the logic I can you on these other ones.

I will explain to you the logic.
What are trying to do is dynamically build the cell references (i.e. "A2", "A4", etc).
The problem is if we use formulas to build those cell references, they are treated as "literal text" and not cell references.
We correct that problem by wrapping it in an INDIRECT function, which tells Excel we are building a range reference, not a string.

So let's break it down.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)
We want to build a formula that returns "A2" when placed in cell "B2", returns "A4" when placed in cell "B3", etc.
So, the way to do this is to first build the "inner" part of the indirect formula (just return the string so you can see what it is doing).

We know that it will always be column "A", so we can hard-code that part.
The ROW() function will return the row number that the formula is placed in.
So, if we enter the following formula in cell B2:
="A" & ROW()
it will return "A2" (it copied down, it will return "A3", "A4", etc).
So it doesn't exactly work when copied down, but we will come back to that later.

Because we want the row value to increment by 2 for every row we copy the formula down, we need to multiply the ROW() function by 2, i.e.
="A" & ROW()*2
However, then that will put "A4" in cell B2, "A6" in cell B3, etc.
So we need to adjust that by subtracing 1 from the ROW() part, i.e.
="A" & (ROW()-1)*2
Now, this returns what we want ("A2" in cell B2, "A4" in cell B3, etc).

Now that we have the calculation working the way we need, we simply wrap it in the INDIRECT function to make it a range reference, i.e.
Excel Formula:
INDIRECT("A" & (ROW()-1)*2)

So the way that I usually approach this is to first build the inner part of the indirect function to return the values you need for each cell (like I showed above).
Then, once you have that working well, just wrap it in the INDIRECT function, and you are good to go!

Give it a shot with your other formulas and see how you do (you will learn a lot more trying this yourself than having me do it for you again).
The first one should be very easy, as it is practically the exact same calculation, just a different column reference.

Just note that the INDIRECT function should replace your current cell reference. So the structure will be like:
=SUBSTITUTE(INDIRECT(...), "2TK", "MDCENB00")
Ok i was able to get it to work for a bit...

=SUBSTITUTE(INDIRECT("A" & (ROW()-1)*2),"2TK","MDCENB00")

copied down but stops working after 13th row down in the column, any reason you can think of for that?
 
Upvote 0
Ok so got column C working with this one using your explination.

=SUBSTITUTE(INDIRECT("A" & (ROW()-1)*2),"2TK","MDCENB00")

im having a hard time with D using this one based off same explination to my understanging (or lack there of)

=SUBSTITUTE(INDIRECT("A" & (ROW()-1)*3),":","")
 
Upvote 0
Ok so got column C working with this one using your explination.

=SUBSTITUTE(INDIRECT("A" & (ROW()-1)*2),"2TK","MDCENB00")

im having a hard time with D using this one based off same explination to my understanging (or lack there of)

=SUBSTITUTE(INDIRECT("A" & (ROW()-1)*3),":","")
OK, because we are wanting the odd number rows now, we need to subtract 1 AFTER we multiply by 2 (rather than before), i.e.
Excel Formula:
=SUBSTITUTE(INDIRECT("A" & (ROW()*2)-1),":","")
 
Upvote 0
Working!!!!! TY Vm, interesting tho it quits working after about row 600, should not need that much tho... TY again!!!!!
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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