+ Reply to Thread
Results 1 to 5 of 5

Create a formula

  1. #1
    Registered User
    Join Date
    04-08-2013
    Location
    Francfort
    MS-Off Ver
    Excel 2003
    Posts
    8

    Create a formula

    Hi all,

    I would like to insert a formula (K2= TC1-K1n/n(MR-1) in Excel. All the variables except K2 would be given in my excel-sheet or could be insert and then calculated automatically.
    Is this possible?

    Thank you for any help, I would really appreciate.

    Greets,

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Create a formula

    I'm hesitant to respond, because it seems so simple that I'm afraid I am missing something in your question. However, with nothing else to go on, this should be as simple as entering the known values into cells, then enter a formula into another cell that computes K2. Assuming it is this simple, I might suggest a basic tutorial on entering formulas into Excel http://office.microsoft.com/en-us/ex...593.aspx?CTT=1

    If it is more complex than that, please help us understand exactly what your question is. One common question with more complex formulas like this one is making sure to get the parantheses in the right places (and always a pain to debug when you get a paranthesis out of place).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    04-08-2013
    Location
    Francfort
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Create a formula

    Hi, I wanted to use it through VBA. I imagined the sheet with just the cells that represent the variables (which I can modify) and cells which would give me the result of the formula from vba just after clicking on a button. This would then give me a graph. Hope it isn't so stupid.

    Sorry if I waisted your time,

    Greets,

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Create a formula

    My mistake -- I didn't realize we were doing this in VBA (I knew it seemed too simple). As easy as this seems in the spreadsheet without VBA, I'm not sure why you want to do it in VBA. I see two basic approaches:

    1) using the .value property, http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx read in the input values from the cells where they are entered. Perform the calculation in VBA. Then, again using the value property, write the result of the calculation to the desired output cell.
    or 2) build the desired formula as a text string (http://msdn.microsoft.com/en-us/libr.../gg264104.aspx). Once the text string is built, use the formula property http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx or the formular1c1 property http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx to write the resulting text string/formula to the desired output cell. r1c1 notation is sometimes easier for this, because each copy of the formula will probably be the same text string, where a1 notation will likely not be the same text string.

    Since you are building a graph, it sounds like there will be multiple input values and output values, so either option will need to occur within a loop to get the complete data set.

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

    Re: Create a formula

    Testco,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    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]

+ 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