+ Reply to Thread
Results 1 to 3 of 3

formula created using user input.

  1. #1
    Registered User
    Join Date
    12-02-2012
    Location
    El Paso, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    formula created using user input.

    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.
    Attached Files Attached Files
    Last edited by david.herrera1; 12-13-2012 at 04:52 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: formula created using user input.

    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    12-02-2012
    Location
    El Paso, Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: formula created using user input.

    How are you Arlu12,

    Honestly, I was not able to solve the problem. I gave up and decided to put it off for a while so I marked the thread as solved so as to not have anybody trouble themselves over it. Maybe that was not a good Idea. I figured if I choose to spend time on the problem again in the future I would re-post another more well defined question. Let me know if what I did is bad forum board etiquette. I have found this board very useful and therefor I want to be as respectful as possible to the contributors.

    David.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1