+ Reply to Thread
Results 1 to 3 of 3

Translating Mathematical Formulas to Excel VBA

  1. #1
    Registered User
    Join Date
    03-23-2016
    Location
    Toronto
    MS-Off Ver
    2007
    Posts
    5

    Translating Mathematical Formulas to Excel VBA

    I am trying to create a function in Excel VBA. This function requires some complex mathematical operations. I am fine with the math, however I don't know the proper syntax to write the operations used in this formula to VBA.

    http://imgur.com/Bijhjje

    How would I reproduce this part of a formula in VBA? Where would I even begin? Thanks.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Translating Mathematical Formulas to Excel VBA

    VBA's not really going to be your friend here. There isn't a built in integral function, but others have made one.

    Then you could just set variables for e and T and z and pi, etc. like

    Please Login or Register  to view this content.
    and use then that way in the equation.

    However: the one thing I'm really not sure on is the infinity upper limit on your integration. No idea how to implement that. And I don't believe Excel natively supports calculus either, and though there appears to be ways to set it up, not sure how that would work with infinity.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

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

    Re: Translating Mathematical Formulas to Excel VBA

    There are basically two ways (whether in VBA or other programming language or with pencil/paper/sliderule) to evaluate integrals. You can use the Fundamental Theorem of Calculus where you come up with an antiderivative, evaluate at the upper and lower limit, and take the difference. Or you can use Riemann sum type algorithms https://en.wikipedia.org/wiki/Riemann_sum Walruseggman's link to MrExcel illustrates a Riemann sum type algorithm.

    Assuming you use a Riemann sum to evaluate the integral, dealing with the upper limit of infinity simply means using a large enough number so that you know that the integral has "converged". If you have forgotten about "improper integrals", it would probably be worthwhile to review the calculus of improper integrals (top page from my internet search for convergence of improper integrals http://www.sosmath.com/calculus/impr...v/convdiv.html ). When considering computer round off error, you might also want to test whether it is important to perform the sum from low to high or from high to low or whether it does not matter.

    At this point, it might be nice to know if you have a specific question related to implementing this in VBA or not. If it really is the "I have no idea where to start", then I think that these introduction to Riemann sums are probably as good a place to start as any. I might add that you might put some research into how others in your field have programmed this. If you can come across and antiderivative or similar formulation for this integral, it will likely simplify the programming quite a bit.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mathematical formulas for considering compounding returns
    By yon85 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-04-2016, 11:28 PM
  2. Need help with Formulas for translating data between two sheets.
    By pip74205 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-21-2014, 12:32 AM
  3. How to create a function of 2 mathematical formulas?
    By killwin98 in forum Excel Formulas & Functions
    Replies: 23
    Last Post: 05-09-2013, 04:54 PM
  4. Help w/ color, T/F, and mathematical formulas
    By corster in forum Excel General
    Replies: 4
    Last Post: 02-05-2010, 02:38 AM
  5. Translating formulas
    By Cameron in forum Excel General
    Replies: 9
    Last Post: 08-03-2006, 06:50 AM
  6. [SOLVED] How do I use Excel 2000 to calculate mathematical formulas in a...
    By Talia in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-05-2006, 04:50 PM
  7. translating formulas
    By Luc Benninger in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-04-2005, 01:06 PM

Tags for this Thread

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