+ Reply to Thread
Results 1 to 5 of 5

SUM function problem / discussion

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Dordrecht
    MS-Off Ver
    Excel 2007
    Posts
    15

    SUM function problem / discussion

    Im comming from a long way to get the following column
    Now i want to sum over the column B but what numbers I want to sum depends of an input number X so
    if cel D1 is 6 i want to sum B1till B6 and if D1 = 9 i want to do the sum over B1 till B9 etc
    A B
    1 0,999829785
    2 0,961374793
    3 0,924398839
    4 0,888845038
    5 0,85465869
    6 0,821787202
    7 0,790180002
    8 0,759788464
    9 0,73056583
    ...
    ...

    I am just curious if there is some sort of condition that does the job
    An alternative solution would be to make a third column with incremental values of B and use D1 as lookup value in a vlookup function with 3 as column index
    (I actually got this idea when i was writing this problem)

    1 0,999829785 0,999829785
    2 0,961374793 1,961204578
    3 0,924398839 2,885603417
    4 0,888845038 3,774448455
    5 0,85465869 4,629107145
    6 0,821787202 5,450894347
    7 0,790180002 6,24107435
    8 0,759788464 7,000862813
    9 0,73056583 7,731428643

    =VLOOKUP($D$1;A:C;3;FALSE)

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721

    Re: SUM function problem / discussion

    Try using INDEX like this

    =SUM(B1:INDEX(B:B;D1))
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-13-2010
    Location
    Module1
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: SUM function problem / discussion

    Try this:

    SUM(OFFSET($B$1,0,0,D1))

  4. #4
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: SUM function problem / discussion

    Input number on column D
    Put this code on column C
    =SUMIF(A:A,"<=" &E1,B:B)
    Click (*) if you received helpful response.

    Regards,
    David

  5. #5
    Registered User
    Join Date
    10-27-2012
    Location
    Dordrecht
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: SUM function problem / discussion

    Tnx guys, this is great learning material!
    from thinking in the start it might not be possible to seeing 4 ways how to do it !

+ 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