+ Reply to Thread
Results 1 to 17 of 17

sumifs not working? Is there a better way?

  1. #1
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    sumifs not working? Is there a better way?

    Hey all. See the attached sample. I'm wanting: if the number in col I matches the number in column D, look in col B for the word "house" and sum those amounts in E.

    I thought a sumifs would work but its producing 0. Seems like there should be a solution but I'm not sure if it's possible or not.

    The actual data is 1200 rows long and with inconsistent placement of the values in column D and B. Ideally would use full columns in formula, ie. B:B, D:D.
    Attached Files Attached Files
    Last edited by pshearer; 02-26-2021 at 07:34 PM.

  2. #2
    Forum Contributor
    Join Date
    11-20-2007
    Location
    Felixstowe, England
    MS-Off Ver
    Excel 2013, 2019
    Posts
    217

    Re: sumifs not working? Is there a better way?

    Why don't you fill down into the blanks in column D, as then it would work? Select D1:D19, Goto[i.e. F5]/Special/Blanks and then type = then UpArrow then Ctrl+Enter

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: sumifs not working? Is there a better way?

    SUMIFS would expect both conditions to be met on the same row. I don't think that what you want is possible with an Excel function/formula.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    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
    80,780

    Re: sumifs not working? Is there a better way?

    Is this what you mean?

    =IF(D2=I2,SUMIF($B$4:$B$10,"House",$E$4:$E$10),0)
    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.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: sumifs not working? Is there a better way?

    @Ali: is that going to scale up? Thought you might be offering Power Query

  6. #6
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    Re: sumifs not working? Is there a better way?

    Quote Originally Posted by AliGW View Post
    Is this what you mean?

    =IF(D2=I2,SUMIF($B$4:$B$10,"House",$E$4:$E$10),0)
    Thanks Ali, but yeah, the problem is that that would not scale. The actual data is about 1200 rows and the placement of the number and "house" is not uniform in the data.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: sumifs not working? Is there a better way?

    It is better to extract the ID number into another helper column, column F, by:

    F2:

    Please Login or Register  to view this content.
    Drag down

    Then SUMIFS in J2:

    Please Login or Register  to view this content.
    Note: B18 was "House " (with a trailing space), delete it.
    Attached Files Attached Files
    Quang PT

  8. #8
    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
    80,780

    Re: sumifs not working? Is there a better way?

    Quote Originally Posted by TMS View Post
    @Ali: is that going to scale up? Thought you might be offering Power Query
    If I had a real clue what was going on I might ...

  9. #9
    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
    80,780

    Re: sumifs not working? Is there a better way?

    Had another look. Here's a PQ solution. you can scale this by selecting a larger area to upload in the first instance.

    M Code:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by AliGW; 02-27-2021 at 04:07 AM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: sumifs not working? Is there a better way?

    Another way... no helper... but unless you DO have 1,000,000 rows, do not go mad and use whole column references. How many rows do you have, at a maximum?

    =SUMPRODUCT(--(LOOKUP(ROW($D$2:$D$1000),ROW($D$2:$D$1000)/($D$2:$D$1000>0),$D$2:$D$1000)=I2),--($B$2:$B$1000="House"),$E$2:$E$1000)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  11. #11
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: sumifs not working? Is there a better way?

    long but non array and quick i spouse
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    Re: sumifs not working? Is there a better way?

    Guys; I really appreciate these responses; you don't even know. The time it's going to save me, the work on my plate, etc. It's 5:00am where I am and I'll be testing these out today. I tested Bebo solution and it works. I'll be testing the others as well and giving appropriate credit and may reach out with some future work if some of you are available. Thanks again guys.

  13. #13
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    Re: sumifs not working? Is there a better way?

    Bebo; this solution works. Amazing.

  14. #14
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    Re: sumifs not working? Is there a better way?

    Quote Originally Posted by Glenn Kennedy View Post
    Another way... no helper... but unless you DO have 1,000,000 rows, do not go mad and use whole column references. How many rows do you have, at a maximum?

    =SUMPRODUCT(--(LOOKUP(ROW($D$2:$D$1000),ROW($D$2:$D$1000)/($D$2:$D$1000>0),$D$2:$D$1000)=I2),--($B$2:$B$1000="House"),$E$2:$E$1000)
    I will try this and respond. Thank you so much for this additional suggestion.

  15. #15
    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
    80,780

    Re: sumifs not working? Is there a better way?

    Any feedback on the solutions Glenn and I offered?

  16. #16
    Registered User
    Join Date
    03-15-2014
    Location
    Nashville, TN
    MS-Off Ver
    365
    Posts
    33

    Re: sumifs not working? Is there a better way?

    Quote Originally Posted by AliGW View Post
    Any feedback on the solutions Glenn and I offered?
    Glenn's works. Ali; I don't know PQ...I don't know how to test that. I'll +1 the hell out of both of you for the answers you gave. Can't thank you guys enough for the help.

  17. #17
    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
    80,780

    Re: sumifs not working? Is there a better way?

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.

+ 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. Replies: 0
    Last Post: 08-22-2017, 03:49 PM
  2. Working with a Sumifs
    By yuenk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-15-2017, 02:17 AM
  3. Sumifs not working
    By Rob K in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2015, 03:05 PM
  4. [SOLVED] Sumifs not working
    By ohanish in forum Excel General
    Replies: 1
    Last Post: 03-27-2015, 01:06 PM
  5. [SOLVED] SUMIFS not working
    By Krishnab4u in forum Excel General
    Replies: 3
    Last Post: 11-21-2013, 06:31 AM
  6. sumifs not working
    By amartino44 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2013, 08:31 PM
  7. [SOLVED] sumifs not working quite right
    By benoj2005 in forum Excel General
    Replies: 13
    Last Post: 09-19-2012, 10:41 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