Forum Discussion

grubesic9's avatar
grubesic9
Copper Contributor
Oct 30, 2018

Excel - 2 fields, always one of them needed to calculate

Hello, I want to calculate a torque, for that i need a force. The force is calculated with the mass and the acceleration of gravity. Is it now possible to give the user a opportunity to either fill in the mass or directly the force. --> Torque = Force * length, Force = mass * gravity.

m = 50 kg --> than F=50*9,81, M=F*l

or

F=500N --> than M=F*l 

Further if i choose to fill in the mass than automatically the force should be calculated and otherwise if i choose to fill in the force, the mass should be automatically calculated.

But the result have to be in the same field "M=..." everytime, no matter if i choose the mass or the force.

Hope that the question is clear :D

 

In the file below i tried it out a little bit different, but i want to reduce the fields, like i just wanna have 5 fields to complete the whole calculation!

1 Reply

  • you can use IF to determine which formula to use. 

     

    =IF(AND(B2<>0;B6<>0;B4="");B2*B6*9,81;IF(AND(B2="";B4<>0;B6<>0);B4*B6;"");"INVALID ENTRY")

     

    however you need to control all the probabilites. The IF formula will check the values on B2-B4 and B6 according to the values on these cells it will choose which formula to use. Otherwise it will display "INVALID ENTRY"

Resources