Reversible formula

TCexcel

New Member
Joined
Dec 3, 2013
Messages
5
Hi all, thanks in advance for taking the time to help.

I have two workbooks because I can't figure out a chain formula that I need to be able to use in reverse.

First workbook:

Row A1 = x
Row B1 = A1*1.25
Row C1 = B1/0.55
Row D1 = C1/0.42

Second workbook (the same formula, just reversed):

Row A1 = B1/1.25
Row B1 = C1*.55
Row C1 = D1*.42
Row D1 = x

I would essentially like to put information in either A1 or D1 and have the other 3 boxes fill out automatically; is this possible or am I stuck using two workbooks...?
Would a circular formula be able to work in my case?

Thanks again for the help.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Why do you have 2 workbooks? Can't you just do this in different columns of the same workbook?
 
Upvote 0
TCexcel,

Welcome to MrExcel.

When you say two Workbooks I assume that you might mean two worksheets?

I see no way that you can get your formula working forwards and backwards unless you utilise vba.

Perhaps, something like the code below on the basis that you may wish to actually see the formulas in place.
To test the code, right click on a sheet tab and paste the code into the code pane on the right.

Then if you enter a value in column D it will populate C B & A with formulas and vice versa if you enter a value in A

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not IsNumeric(Target) Then
MsgBox "Please enter a number!!"
Application.Undo
Exit Sub
End If
If Target.Column = 1 Then
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Target.Offset(0, 1).FormulaR1C1 = "=RC[-1]*1.25"
Target.Offset(0, 2).FormulaR1C1 = "=RC[-1]/0.55"
Target.Offset(0, 3).FormulaR1C1 = "=RC[-1]/0.42"
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
If Target.Column = 4 Then
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
Target.Offset(0, -3).FormulaR1C1 = "=RC[1]/1.25"
Target.Offset(0, -2).FormulaR1C1 = "=RC[1]*0.55"
Target.Offset(0, -1).FormulaR1C1 = "=RC[1]*0.42"
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub

Hope that helps in some way.
 
Last edited:
Upvote 0
I don't think you need to use VBA. A simple change of formatting will do just fine. See below:

ABC
1=B1[input information here]=C2/1.25
2=A1*1.25=C3*0.55
3=A2/0.55=C4*0.42
4=A3/0.42=B1

<tbody>
</tbody>


You put the information in cell B1, and the formula runs both ways.
 
Upvote 0
This code works perfectly, thank you so much.

I was using two worksheets* because I needed to calculate the final price after markups. If the final price was too high/low we would adjust it, but I would then need to know the adjusted cost of the item from the manufacturer (during the meeting, no less).

Having two worksheets was not going to work out with the number of items that were going to be added to the list, and this one post has saved me from scrutiny.

Thank you again.

Drinks are on me if I get to visit the UK :)
 
Upvote 0

Forum statistics

Threads
1,216,094
Messages
6,128,785
Members
449,468
Latest member
AGreen17

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