+ Reply to Thread
Results 1 to 7 of 7

Sigma Notation using VBA

  1. #1
    Registered User
    Join Date
    03-21-2014
    Location
    Macomb Twp., MI
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Sigma Notation using VBA

    Hi,

    Similar to this thread: http://www.excelforum.com/excel-gene...-in-excel.html

    I'm trying to come up with a VBA solution to.... Sigma from j=0 to i of: L((i-j)/i)*b*t. Any help would be appreciated, thanks.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,576

    Re: Sigma Notation using VBA

    In most programming languages, I would use some kind of For...Next loop for this: http://msdn.microsoft.com/en-us/library/5z06z1kb.aspx

    Please Login or Register  to view this content.
    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
    03-21-2014
    Location
    Macomb Twp., MI
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sigma Notation using VBA

    I did the following...

    Please Login or Register  to view this content.
    Then I went back to the spreadsheet and input =Sigma(C7) and returned with error: "Compile error: Invalid outside procedure"

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,576

    Re: Sigma Notation using VBA

    So you are trying to create a user-defined function (UDF). Here's a tutorial from MS on creating UDF's http://office.microsoft.com/en-us/ex...001111701.aspx

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,152

    Re: Sigma Notation using VBA

    try this:
    Please Login or Register  to view this content.
    Where you use formula as (based on this example):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Where C6:C9 is range of your variables C6, C8 i C9 (C7 must be empty!!!). Or define them somewhere else.
    And A1 is your value of i
    Never use Merged Cells in Excel

  6. #6
    Registered User
    Join Date
    03-21-2014
    Location
    Macomb Twp., MI
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sigma Notation using VBA

    Ok so here is what I did...

    Please Login or Register  to view this content.
    ... and then in an Excel cell I had: =Sigma(C7) and I get #VALUE! as the cell value. Cell C7 has the number '4' in it. Cells C6, C8, and C9 are all integers greater than '0'.

    Where did I drop the ball?

  7. #7
    Registered User
    Join Date
    03-21-2014
    Location
    Macomb Twp., MI
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sigma Notation using VBA

    Quote Originally Posted by zbor View Post
    try this:
    Please Login or Register  to view this content.
    Where you use formula as (based on this example):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Where C6:C9 is range of your variables C6, C8 i C9 (C7 must be empty!!!). Or define them somewhere else.
    And A1 is your value of i
    I just saw your post... I will try right away. THANKS!

  8. #8
    Registered User
    Join Date
    03-21-2014
    Location
    Macomb Twp., MI
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Sigma Notation using VBA

    It worked. Thanks zbor!

+ 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. sigma notation (without lists or tables)
    By tonyjnel in forum Excel General
    Replies: 5
    Last Post: 07-25-2015, 01:09 PM
  2. Sigma Notation or Sum
    By bse in forum Excel General
    Replies: 4
    Last Post: 11-20-2014, 04:45 AM
  3. [SOLVED] Sigma Function
    By ganesh81289 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2012, 12:37 PM
  4. [SOLVED] how do I get STDEV() 2 sigma?
    By jimbo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-25-2006, 03:55 AM
  5. [SOLVED] Sigma Function?
    By Maria Garcao in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-15-2005, 06:05 PM

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