+ Reply to Thread
Results 1 to 3 of 3

average the sum of every seventh number from 3 to a final value using for..Next loop

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    united states
    MS-Off Ver
    Excel 2010
    Posts
    64

    average the sum of every seventh number from 3 to a final value using for..Next loop

    I wrote this code to find the average sum of every seventh number from 3 to whatever the user enters in the box -
    The code I wrote doesn't give the correct average for example if user enter 20, the output should be average which for 20 is 3 because (3+10+17) / 3

    Please Login or Register  to view this content.
    Can someone check this for me please?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: average the sum of every seventh number from 3 to a final value using for..Next loop

    Since in the past you have indicated that this is for a school project I will respond with hints rather than full solutions.

    This serves no purpose as it is not used in any other process
    Please Login or Register  to view this content.
    This is ok in VB but I think it will error in VBA. Look up For next loop in VBA.
    Please Login or Register  to view this content.

    This is wrong. If sum is your variable you will need to preserve the existing value of the variable when you add the variable count to it
    Please Login or Register  to view this content.
    Side note: It is usually not a good idea to use built in function names for variables and instead tweak them using the variable type. (i.e. iSum or intSum instead of just sum)
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    united states
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: average the sum of every seventh number from 3 to a final value using for..Next loop

    I don't get it - I never thought I would be this dumb -
    Can you just show it to me. the week past and I didn't get the point on it but I need to learn it.
    Would do me a favor and correct the mistake that I have in that.

+ 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. do-while loop to average the sum of every seventh number
    By 1Melina in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2016, 05:11 PM
  2. [SOLVED] Formula for copying the sixth & seventh digit from a number
    By shivanikharbanda in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-25-2014, 11:22 AM
  3. how to divide the FINAL RATING with weighted average?
    By nathanjohnston in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-01-2013, 09:51 AM
  4. Replies: 6
    Last Post: 08-16-2013, 10:04 PM
  5. [SOLVED] VBA loop to copy a worksheet a number of times, assign name each time based on loop number
    By TBG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2012, 10:54 PM
  6. Replies: 3
    Last Post: 01-16-2012, 09:07 PM
  7. [SOLVED] Final Value, For / Next Loop
    By Neal Zimm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-01-2005, 10:30 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