hello,
Maybe somebody can give me some assistance.
I am trying to produce either a formula, or some vba code that will create a formula , or a set of formulas in a cell for me.
I am attempting to produce a way to analyze a complex system for reliability. I can write a formula that does this in one cell, but I need a way for a user to do this. At the moment I have this
=IF(AND(B6="f",C6="F",D6="F",E6="F"),0,1).
Let me give an example of what I want to do. In essence I am trying to trace a path with excel.
Here is a Picture
If a signal is to make it thru this system it must travel from right to left. It must go thru component 1, then thru unit 2 and three, and then thru unit 4. These four components are the system which is under analysis.
This system has three failure states:
State 1: unit 1 fails, system fails
State 2, Unit 2 and 3 fails, system fails
State 3, unit 4 fails, system fails.
In cell formula form this can be represented as
State1…. =if( unit 1 fails,0,1)
State2…. =if(unit 2 fails, and , unit 3 fails, 0,1)
State 3… = if(unit 4 fails, 0,1)
The system components are either working or not, therefor they, individually, exist in two state. I have defined those states in this example as “S” success, or “F”, fail. Success means the component works. Fail means the component has failed.
So the above shown system configuration reliability can be represented by a sum (in a way) of all available states, minus the probability of the failed states.
What I need is for a user to select the failure states of their own system and for them to be able to input them into excel, and for excel to be able to create the formulas.
Example:
I have a four component system, like above: ( ON A SPREADSHEET THE INFORMATION WOULD BE REPRESENTED LIKE SO)
A1 B1 C1 D1
0 1 1 1 Fai =if(A1=0,0,1)
1 0 1 1 Success =if(and(b1=0,c1=0), 0,1)
1 1 0 1 Success =if(and(b1=0,c1=0), 0,1)
1 1 1 0 Fail =if(D1=0,0,1)
1 0 0 1 Fail =if(and(b1=0,c1=0), 0,1)
So in this configuration I have three failure states which I want a user to be able to define.
In essence I want to write VBA code that will produce a formula that I can drop into a spread sheet Cell.
My thoughts are this. If you have a simpler or better idea please let me know.
The user would have an input like this
Cell 1, 2, 3, 4,
State 1 0, 1, 1, 1, Fail --- will be (=if (Cell(1,1)=0, fail,success)
State2 1, 0, 0, 1, Fail ---will be ( =if (and(cell 2,2)=0,cell(2,3)=0,0,1)
State ….. 1, 1, 1, 0 Fail ---- will be (=if ( cell (3,4)=0,0,1)
I want the user to input the failure state on a spreadsheet or a userform. And them I want excel to generate the formula.
Bookmarks