+ Reply to Thread
Results 1 to 3 of 3

VBA, calculating sum of squares of odd numbers from 1 up to 20

  1. #1
    Registered User
    Join Date
    05-29-2022
    Location
    POland
    MS-Off Ver
    2016
    Posts
    9

    Question VBA, calculating sum of squares of odd numbers from 1 up to 20

    Hello friends.
    I am going to write a code on VBA that calculates the sum of squares of odd numbers from 1 up to 20.
    I would be glad to see your messages.

    Thanks

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: VBA, calculating sum of squares of odd numbers from 1 up to 20

    Please Login or Register  to view this content.
    Or

    =SUMPRODUCT(A1:A10*A1:A10)

    numbers in A1;A10
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

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

    Re: VBA, calculating sum of squares of odd numbers from 1 up to 20

    I notice John assumes that this is an exercise for practicing writing loops. I would note that, as with many arithmetic progressions, the sum of odd numbers has a very simple formula -- the sum of the first n odd numbers is n^2. So, the sum of the first 10 (1 to 19) is 100. Proof here: https://www.cuemath.com/algebra/sum-of-odd-numbers/ I'll assume for now that you can program that into VBA (or any other programming language you choose to use).
    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. [SOLVED] average of 1/squares of an array of numbers
    By abalkees in forum Excel General
    Replies: 3
    Last Post: 08-13-2015, 12:18 AM
  2. Finding the Sum of Squares
    By T.J. Lanza in forum Excel General
    Replies: 7
    Last Post: 03-17-2010, 04:08 PM
  3. Least Squares
    By scantor145 in forum Excel General
    Replies: 1
    Last Post: 01-19-2010, 11:05 AM
  4. Add the squares
    By Zantier in forum Excel General
    Replies: 11
    Last Post: 03-25-2009, 12:05 AM
  5. [SOLVED] chi squares
    By Rozie in forum Excel General
    Replies: 1
    Last Post: 06-29-2006, 05:00 PM
  6. [SOLVED] Squares
    By MSL in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2005, 12:05 PM
  7. Replies: 5
    Last Post: 02-10-2005, 08: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