+ Reply to Thread
Results 1 to 11 of 11

Sum IF Number is Between Certain Range

  1. #1
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Sum IF Number is Between Certain Range

    Hi Friends

    I want to sum the columns if the number in the cell is between 1215 & 1290. I have attached the example worksheet.

    Can you please assist?

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Sum IF Number is Between Certain Range

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and fill across.
    Dave

  3. #3
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Sum IF Number is Between Certain Range

    Thank you so much Dave. Genius.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Sum IF Number is Between Certain Range

    You are welcome. Thank you for the feedback, added rep and marking your thread Solved.

  5. #5
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Sum IF Number is Between Certain Range

    Quote Originally Posted by FlameRetired View Post
    . . . =SUMPRODUCT(B4:B18,--(--LEFT($A$4:$A$18,5)>=1215),--(--LEFT($A$4:$A$18,5)<=1290)) . . .
    OP seems to have Excel 2016, so wouldn't =SUMIFS(B4:B18,$A4:$A18,">01215",$A4:$A18,"<=01290") be simpler and easier for others to maintain? If 1215 were entered as a number in X1 and 1290 entered as a number in Y1, =SUMIFS(B4:B18,$A4:$A18,">0"&X1,$A4:$A18,"<=0"&Y1) or =SUMIFS(B4:B18,$A4:$A18,">"&TEXT(X1,"00000"),$A4:$A18,"<="&TEXT(Y1,"00000")) .

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Sum IF Number is Between Certain Range

    Wasn't sure which way to jump. As and afterthought had actually set up a helper column in G --left(a4,5) to do the SUMIFS. Then wait and see OP's response. Never went further.

    Thanks for the feedback, but I get 0s with all those. A4:A18 all have letters following the numbers.

  7. #7
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Sum IF Number is Between Certain Range

    I tried the both of this formula but it doesn't work as column A contains number and text. can you please try?
    Please Login or Register  to view this content.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Sum IF Number is Between Certain Range

    I had same results as you.

  9. #9
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Sum IF Number is Between Certain Range

    Quote Originally Posted by FlameRetired View Post
    . . . but I get 0s with all those. A4:A18 all have letters following the numbers.
    Oops. Good point, and I also screwed up on > rather than >=. Make those

    =SUMIFS(B4:B18,$A4:$A18,">=01215 *",$A$4:$A$18,"<=01290*")

    and

    =SUMIFS(B4:B18,$A4:$A18,">=0"&$X1&" *",$A$4:$A$18,"<=0"&$Y1&"*")

    Note: Excel seems to be EXTREMELY finicky about the space before the asterisk in the 1st comparison and no space before it in the 2nd comparison.

    NBD in the long-run because the eventual FILTER function will come to the rescue, =SUM(FILTER(B4:B18,($A4:$A18>="01215")*($A4:$A18<"01291"))) where <"01291" is equivalent to <="01290" followed by any arbitrary characters.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Sum IF Number is Between Certain Range

    Wow! Thanks for that hrlngrv. I had no idea FILTER would let us "cheat" with mixed strings like that.

  11. #11
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Sum IF Number is Between Certain Range

    Thanks you so much hrlngrv..good to know the other ways 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)

Similar Threads

  1. Query date range and ref number match to return another reference number
    By 27paul0 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2015, 07:31 AM
  2. [SOLVED] How2 find number in range and return that number or if doesn't exist then the next highest
    By Crawfinator1 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-06-2014, 08:52 AM
  3. [SOLVED] Count number of occurances below a range, within a range, and below a range
    By maacmaac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2013, 11:36 PM
  4. Counting number of values within a date range equal or great to a number
    By diablo_719 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 02:55 PM
  5. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  6. Replies: 1
    Last Post: 01-17-2013, 10:44 AM
  7. [SOLVED] Define a range of fixed number of columns, but unlimited number of rows
    By ccopac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 02:23 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