Help with circular reference problem

bradyj7

Board Regular
Joined
Mar 2, 2011
Messages
106
Hi there,

I have three columns Time (t) Charge (Q) and Current (I).

The Time column contains second values 1,2,3 etc.

Q is defined as I * t.

I is defined as Q * 2.

So for first time step I is given a value so Q can can be calculated. Then from Q, I can be calculated. Now for the next time step I want the new value for I to be used to calculate Q and then I again and so on

Code:
t	                 Q	                            I	
1	1* 0.01(starting value for I)	         0.01*2	
2	This should be 0.02 *2	        This should be 0.04*2	
3			.....                      ......
4			.....                      ......

Would anyone know how to code this?

Thanks in advance

John
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,

Assuming t is in column A with all the number of t values required, Q is in column B and I in column C then, with your value of t=1 in cell A2, then something like:
Code:
Sub MyIQT()
Dim x As Long, I As Double
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With
I = InputBox("Enter a starting value for I: ")
Range("B2") = Range("A2") * I
Range("C2") = Range("B2") * 2
x = Range("A" & Rows.Count).End(xlUp).Row
With Range("B3:B" & x)
    .FormulaR1C1 = "=RC[-1]*R[-1]C[-1]"
    .FillDown
End With
With Range("C3:C" & x)
    .FormulaR1C1 = "=RC[-1]*2"
    .FillDown
End With
With Application
    .ScreenUpdating = True
    .Calculation = xlAutomatic
End With
End Sub
 
Upvote 0
Hi,

Thanks for the replies. I'm trying to implement this into a larger macro that I have to run on a lot of files. I couldn't not code it because the Q column is before the I column and so it wouldn't update the new I value for each time step. I'll try the code above and let you know how I get on.

Thank you
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,270
Members
452,902
Latest member
Knuddeluff

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