+ Reply to Thread
Results 1 to 5 of 5

Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    2

    Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    I am not an Excel wizard, and my math skills are rusty, but any help with doing the following would be much appreciated:

    A formula that only accepts whole numbers (0,1,2,...) from a specified cell
    It then needs to output: n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    For instance if n=7 the output should be 7+6+5+4+3+2+1 = 28
    or if n=10 then it should output 55 and so on.

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    Try this...

    If your value is on A1, then in B1: =(A1+1)*A1/2

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    assume your data is in A1, use this...
    =INT(A1)*(INT(A1)+1)/2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    assume your data is in A1, use this...
    =INT(A1)*(INT(A1)+1)/2

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Need to do n+(n-1)+(n-2)...(n-x) where x is 1 less than n

    Thank you both, that did the trick
    Thread marked as solved

+ 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