+ Reply to Thread
Results 1 to 3 of 3

Make UDF for Mathematical Sum function

  1. #1
    Registered User
    Join Date
    09-17-2007
    Posts
    2

    Make UDF for Mathematical Sum function

    Hi,

    I am very new to Excel. I want to make a sum function that acts like the one I'm familiar with from Math class. I specifically want to make a custom function that allows me to make this sum

    Sum of x^i, as i goes from y to z (in increments of one)

    so if x = .9, y=3, and z = 5

    .9^3 + .9^4 + .9^5

    (which is equal to 1.97559)

    Perhaps I don't need a custom function for this but I couldn't figure out a way to do this with the regular Excel functions. (If someone can make a "general" sum function, that would be even cooler, but not necessary. I need only one that sums x^i) Thanks!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Here's a UDF that will do the mathematical calculation you're after. Place this code into a module, then you can call it on any worksheet in that workbook by using the formula

    =sumExponents(value1, value2, value3) where value's 1, 2 and 3 can be numeric values or cell references to numeric values.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-17-2007
    Posts
    2
    Thanks so much! That will work.

    I also realized right after that I could just write it as the sum of a geometric series,

    =((x^y-x^(z+1))/(1-x)

    There's more than one way to skin a cat!

+ 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