ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Noob question (https://www.excelbanter.com/excel-worksheet-functions/48628-noob-question.html)

letmeplay1977

Noob question
 
Im sure this is a real simple thing to do, but I wasn't able to find anything using the forum search. This is probably because i don't know what I am trying to do is called.

Basically, I have two values that are related to each other. Right now i have it set up so that one value (A) is a user-entered value and the other one (B)is calculated based on the entered value(A). This works great, but i would also like to make it so that if i chose, i could enter a value for B and A would be calculated based on that. Im looking for flexibility so that i don't have to create another worksheet with the inverse operation. I want to be able to enter A or B and have the other automatically calculated. Other values in the worksheet are based on these two values, so they would have to work out also.

Sorry for the rookie question, and thanks for any replies!

Dan

i have the same problem before, but I could only solve by introducing another
2 column

Say A, B, C,D
A is the Select which you want
B is the value you are going to type
C is Formula C
D is Formual D

For C: formula should be =IF(A="C", C=B, function(D))
For D: formula should be =If(B="D", D=B, function(C))

Would be great if other could have other suggestion.

"letmeplay1977" wrote:


Im sure this is a real simple thing to do, but I wasn't able to find
anything using the forum search. This is probably because i don't
know what I am trying to do is called.

Basically, I have two values that are related to each other. Right now
i have it set up so that one value (A) is a user-entered value and the
other one (B)is calculated based on the entered value(A). This works
great, but i would also like to make it so that if i chose, i could
enter a value for B and A would be calculated based on that. Im
looking for flexibility so that i don't have to create another
worksheet with the inverse operation. I want to be able to enter A or B
and have the other automatically calculated. Other values in the
worksheet are based on these two values, so they would have to work out
also.

Sorry for the rookie question, and thanks for any replies!


--
letmeplay1977


Sandy Mann

A cell cannot contain a user entered value and a formula at te same time. I
think that you would need an Event Macro. Right-click on the sheet tab and
try something like:

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

If Target.Address = Range("A1").Address Then
Cells(1, 2).Value = Target.Value * 2.5
End If

If Target.Address = Range("B1").Address Then
Cells(1, 1).Value = Target.Value / 2.5
End If

Application.EnableEvents = True
End Sub

Entering a value in A1 or B1 will cause the other cell to calculate
--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk

"letmeplay1977" wrote in message
...

Im sure this is a real simple thing to do, but I wasn't able to find
anything using the forum search. This is probably because i don't
know what I am trying to do is called.

Basically, I have two values that are related to each other. Right now
i have it set up so that one value (A) is a user-entered value and the
other one (B)is calculated based on the entered value(A). This works
great, but i would also like to make it so that if i chose, i could
enter a value for B and A would be calculated based on that. Im
looking for flexibility so that i don't have to create another
worksheet with the inverse operation. I want to be able to enter A or B
and have the other automatically calculated. Other values in the
worksheet are based on these two values, so they would have to work out
also.

Sorry for the rookie question, and thanks for any replies!


--
letmeplay1977





All times are GMT +1. The time now is 06:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com