+ Reply to Thread
Results 1 to 5 of 5

Sum values in one column based on values in another column and user input

  1. #1
    Registered User
    Join Date
    04-02-2009
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Sum values in one column based on values in another column and user input

    I am trying to create a formula that sums one column based on the values in another and a user-defined start and stop. Let me try to explain:

    A B
    0 15
    1 10
    2 20
    3 5
    4 8
    5 25
    6 12

    Start: 1
    End: 4

    The user inputs value for Start and Stop, then the function looks at column A, finds the value for start and stop, then sums everything from column B together from the start and stop points. So, the answer would be 43 in this example. Thanks in advance!!

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Sum values in one column based on values in another column and user input

    Will the values in column A always be sorted as in your example?

    If so, try this:

    =SUMIFS(B:B,A:A,">="&E1,A:A,"<="&E2)

    With 1 in E1 and 4 in E2.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,255

    Re: Sum values in one column based on values in another column and user input

    Like this:

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    H
    I
    39
    0
    15
    start
    1
    40
    1
    10
    stop
    4
    41
    2
    20
    42
    3
    5
    43
    43
    4
    8
    44
    5
    25
    45
    6
    12
    Sheet: Events

    Excel 2016 (Windows) 32 bit
    I
    42
    =SUMIFS($F$39:$F$45,$E$39:$E$45,">="&I39,$E$39:$E$45,"<="&I40)
    Sheet: Events
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    04-02-2009
    Location
    Washington, USA
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Sum values in one column based on values in another column and user input

    Perfect! Thanks!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Sum values in one column based on values in another column and user input

    You're welcome. Happy to help.

    If that solved your question, please mark this thread as SOLVED.

+ 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. How to Loop through Column and Modify Values Based on User Input
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2015, 11:38 AM
  2. [SOLVED] Transpose a long column into delimiters separated values according to values in input box
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-27-2014, 01:32 PM
  3. [SOLVED] Grab Values in a Row based on filter -- Move to another spreadsheet -- Input column Nam
    By tsgallivan12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2013, 01:24 PM
  4. [SOLVED] Start a macro based on column input values
    By cmm5350 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-02-2012, 10:05 AM
  5. How to start a macro based on column input values
    By cmm5350 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2012, 09:35 AM
  6. Instantly change column values after copy/insert rows based on input - Selection parameter
    By BuzzOffSweetheart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 09:47 AM
  7. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 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