+ Reply to Thread
Results 1 to 9 of 9

Sum Values That Are Less Than Or Equal To Values In Another Column

  1. #1
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Sum Values That Are Less Than Or Equal To Values In Another Column

    Hi. I need help with modifying a formula that I created.

    Current formula: =SUMIFS(B:B,B:B,"<="&A:A)

    How can I modify this formula to allow me to enter any value in column B and to only sum values that are not greater than the values in column A?

    Ex:

    .....A.....B
    1...2......1 < value to sum = 1
    2...2......2 < value to sum = 2
    3...2......3 < value to sum = 2
    4...5......4 < value to sum = 4
    5...7......9 < value to sum = 7

    Sum of column B = 1+2+2+4+7 = 16
    Last edited by jhudson444; 10-08-2013 at 10:48 PM.

  2. #2
    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,946

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    Based on the sample provided, Im not sure I follow your logic?
    4...5 you select 4 (1st value < 2nd value, you select 1st value)
    5...7 you select 7 (1st value < 2nd value, you select 2nd value)

    Maybe a helper column with this, and then sum the helper?
    =IF(B1>=A1,A1,B1)
    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

  3. #3
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    Sorry, allow me to rewrite the table:

    A.....B
    2.....1 < value to sum = 1
    2.....2 < value to sum = 2
    2.....3 < value to sum = 2
    5.....4 < value to sum = 4
    7.....9 < value to sum = 7

    If the value in column B is less than or equal to the value in column A, then sum the value in column B. If the value in column B is greater than the value in column A, than sum the value in column A.

  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,946

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    as suggested, a helper with this copied down...
    =if(B1<=A1,B1,A1)
    then sum the helper

  5. #5
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,373

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    Just upload your dummy workbook and your goal bro....

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    =SUM(IF(A1:A5 < B1:B5, A1:A5, B1:B5))

    Confirmed with Ctrl+Shift+Enter
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    Thanks, that works!

    Is there a way to rewrite that formula so that it does not have to be entered as an array, or is an array formula the only way to calculate sums like this?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    =sumproduct((a1:a5<=b1:b5)*(a1:a5) + (a1:a5>b1:b5)*(b1:b5))

  9. #9
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Sum Values That Are Less Than Or Equal To Values In Another Column

    Thank you and everyone else for your help!

+ 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. Modifying A Formula
    By Mangesh Yadav in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 02:05 PM
  2. Modifying A Formula
    By carl in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. [SOLVED] Modifying A Formula
    By carl in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  4. Modifying A Formula
    By carl in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Modifying A Formula
    By carl in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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