+ Reply to Thread
Results 1 to 6 of 6

How to automatically sum the squares, cubes, etc, of a list of integers?

  1. #1
    Registered User
    Join Date
    04-19-2014
    Location
    France
    MS-Off Ver
    Excel 2013
    Posts
    25

    Question How to automatically sum the squares, cubes, etc, of a list of integers?

    Hello.

    I have a lot of lists of integers and I want to sum their Xth power automatically, for X = -3, -2, -1, -1/2, 0, 1/2, 1, 2, 3, 4, 5, 6.

    For example, take this short list of integers: 1 2 3 4 6 12

    The sum of their Xth power must be: 1^X + 2^X + 3^X + 4^X + 6^X + 12^X

    How can I do that?

    Thanks in advance for your answers.
    Last edited by Terminatrix; 06-13-2014 at 08:52 AM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to automatically sum the squares, cubes, etc, of a list of integers?

    Hi,

    With your values in e.g. A1:A10 and your index in e.g. B1:

    =SUMPRODUCT(POWER(A1:A10,B1))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    04-19-2014
    Location
    France
    MS-Off Ver
    Excel 2013
    Posts
    25

    Re: How to automatically sum the squares, cubes, etc, of a list of integers?

    Thank you XOR LX, your function worked.

    There is just one last little problem: the function doesn't work for X = 0

    Basically for X = 0 we should get:
    1^0 + 2^0 + 3^0 + 4^0 + 6^0 + 12^0
    = 1 + 1 + 1 + 1 + 1 + 1
    = 6
    It should just give us the quantity of integers present in the list..

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to automatically sum the squares, cubes, etc, of a list of integers?

    You mean you've included some blank cells in the range as well?

    Regards

  5. #5
    Registered User
    Join Date
    04-19-2014
    Location
    France
    MS-Off Ver
    Excel 2013
    Posts
    25

    Re: How to automatically sum the squares, cubes, etc, of a list of integers?

    Oh yes, you're correct. Oops.

    Just fixed it, everything is perfect now.

    Thanks again for everything.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to automatically sum the squares, cubes, etc, of a list of integers?

    You're welcome.

    Actually if your set-up is such that your range may include blanks, you can use this array formula**:

    =SUM(IFERROR(POWER(A1:A10,B1),0))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

+ 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. math function cubes & multiple squares
    By MelissaBeynon in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-25-2010, 01:33 AM
  2. [SOLVED] A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-07-2005, 12:05 AM
  3. [SOLVED] A list of Consecutive Integers, can I search for missing integers
    By Harlan Grove in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 08:05 AM
  4. A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  5. [SOLVED] A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM

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