Fill variable formula in adjacent column

scotsrule08

New Member
Joined
Jun 21, 2018
Messages
45
I have a dynamic set of data in column A. I need to paste a formula in column B all of the way down to the last row with data in column A. The formula does need to change the reference all the way down.

For example

A1: Data B1: =A1....formula stuff
A2: Data B2: =A2....formula stuff
A3: Data B3: =A3....formula stuff
Etc....

Thank you!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try,

Code:
=if(A1="","",Formula stuff)
 
Last edited:
Upvote 0
I should have been more specific. Here is the formula I need to fill down in Column B based on how far down column A goes.

=MID(A2,FIND("~",SUBSTITUTE(A2," ","~",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))+1,LEN(A2)-FIND("~",SUBSTITUTE(A2," ","~",LEN(A2)-LEN(SUBSTITUTE(A2," ",""))))-5)

Thank you!
 
Upvote 0
Not sure if I've misunderstood, but put your formula in B2 then double click the bottom right hand corner of B2 & the formula will fill down.
 
Upvote 0
It might have helped if you said you needed VBA in the first place. ;)

Code:
Sub AddFormula()
Range("B2", Range("A" & Rows.Count).End(xlUp).Offset(, 1)).Formula = "=MID(A2,FIND(""~"",SUBSTITUTE(A2,"" "",""~"",LEN(A2)-LEN(SUBSTITUTE(A2,"" "",""""))))+1,LEN(A2)-FIND(""~"",SUBSTITUTE(A2,"" "",""~"",LEN(A2)-LEN(SUBSTITUTE(A2,"" "",""""))))-5)"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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