circular reference

  • Thread starter circular reference
  • Start date
C

circular reference

I am trying to make the following functionality:

Two cells:
1. cell A1 which in it I will write a price without VAT.
2. cell A2 which in it I will write a price with VAT.

The functionality will be:
1. If I am writing the price without VAT in A1, the price will automatically
be calculated into A2 and will be written with VAT.
2. on the contrary of step 1.

How am I doing this ?

Another problem I encountered is:
When I write in A1 the price, I am overriding the formula of the cell.
Do I have any option to define a formula for a cell that enables me to write
a number in the cell without overriding the formula that is defined to that
cell ?

Thanks, Ido
 
S

Sandy Mann

I don't think that you can do what you want with formulas, I think that you
will need VBA.

Right click on the sheet tab and select View Code then copy and paste the
following code into the Sheet Module:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Range("A:A")) Is Nothing Then GoTo ColB
Cells(Target.Row, 2).Value = _
Application.Round(Cells(Target.Row, 1).Value * 1.175, 2)
ColB:
If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
Cells(Target.Row, 1).Value = _
Application.Round(Cells(Target.Row, 2).Value / 1.175, 2)
End Sub

The Columns A & B should then do what you want - that is assuming that your
VAT rate is 17.5%

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
B

Bernard Liengme

If VBA is not the way you want to go, and you would be happy using columns A
and B for input and C and D for the 'actual' data:

In C1 enter =IF(A1>0,A1,ROUND(B1/(1+13%),2))
In D1 enter =IF(B1>0, B1,ROUND(A1*(1+13%),2))

Of course, adjust 13% to local value
best wishes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top