+ Reply to Thread
Results 1 to 9 of 9

SUMPRODUCT Formula, but need items to fall in same category

Hybrid View

  1. #1
    Registered User
    Join Date
    01-31-2014
    Location
    Washington, DC
    MS-Off Ver
    Excel 2010
    Posts
    1

    SUMPRODUCT Formula, but need items to fall in same category

    I have attached a SUMPRODUCT sheet using more than 2 Criteria, but I have a criteria which falls into the same category but identified differently on my list. EX: Groceries13, Groceries 26, and Grocerie56 and need to be summed in the category of Groceries.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-22-2014
    Location
    genoa, italy
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: SUMPRODUCT Formula, but need items to fall in same category

    hi,
    is this file ( http://wikisend.com/download/302488/Sum based on 2 criteria new.xlsx ) enough to satisfy your need ?
    it won't work if you can have Gas1, Gas2 etc , and it may not work if you add new categories with long names beginning like some others.
    AL

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: SUMPRODUCT Formula, but need items to fall in same category

    Quote Originally Posted by AL1976 View Post
    hi,
    is this file ( http://wikisend.com/download/302488/Sum based on 2 criteria new.xlsx ) enough to satisfy your need ?
    it won't work if you can have Gas1, Gas2 etc , and it may not work if you add new categories with long names beginning like some others.
    AL
    As you know the idea of a forum is to solve poster's problems and share the solution with other members. Adding a link to an external file is potentially unsafe and may keep members form getting the solution ( due to admin settings at work or whatever reason).

    So, if you could post the solution on the forum, everybody will gain from it - Thank you

  4. #4
    Forum Contributor
    Join Date
    01-22-2014
    Location
    genoa, italy
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: SUMPRODUCT Formula, but need items to fall in same category

    Quote Originally Posted by Pepe Le Mokko View Post
    As you know the idea of a forum is to solve poster's problems and share the solution with other members. Adding a link to an external file is potentially unsafe and may keep members form getting the solution ( due to admin settings at work or whatever reason).

    So, if you could post the solution on the forum, everybody will gain from it - Thank you
    I know....I understand....but sometimes, quite often actually, from my computer I don't manage to attach a file directly on this site.
    Sorry...

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: SUMPRODUCT Formula, but need items to fall in same category

    You can try this
    =SUMPRODUCT(--($B$2:$B$16>=$G$2), --($B$2:$B$16<=$G$3), --(ISNUMBER(SEARCH(F5,$C$2:$C$16))), $D$2:$D$16)

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: SUMPRODUCT Formula, but need items to fall in same category

    Or this one

    =SUMPRODUCT(($B$2:$B$16>=$G$2)*($B$2:$B$16<=$G$3)*(LEFT($C$2:$C$16,LEN(F5))=$F5), $D$2:$D$16)



    Also, there is word Electric is misspelled in column C.
    Last edited by AlKey; 01-31-2014 at 12:18 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Forum Contributor
    Join Date
    01-22-2014
    Location
    genoa, italy
    MS-Off Ver
    Excel 2007
    Posts
    134

    Re: SUMPRODUCT Formula, but need items to fall in same category

    Pepe's solution is the right one, indeed, better than mine.
    AL

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: SUMPRODUCT Formula, but need items to fall in same category

    Another way is by using this array formula, so it needs to be confirmed with Ctrl+Shift+Enter

    G5 =SUMPRODUCT(--($B$2:$B$16>=$G$2), --($B$2:$B$16<=$G$3), --(IF(NOT(ISERROR(SEARCH(F5,$C$2:$C$16)>0)),$C$2:$C$16<>"")), $D$2:$D$16)
    and then drag down.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: SUMPRODUCT Formula, but need items to fall in same category

    With all respect, isn't this overkill? What does --(IF(NOT(ISERROR(SEARCH(F5,$C$2:$C$16)>0)),$C$2:$C$16<>"") do more than --(ISNUMBER(SEARCH(F5,$C$2:$C$16)) ?

    SUMPRODUCT already works with arrays. Embedding it in an array formula will not speed things up

+ 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. Scoring (Ranking?) items that fall within a number of 39 parameters
    By chiefweasel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2013, 10:53 AM
  2. Replies: 3
    Last Post: 07-27-2012, 03:01 PM
  3. [SOLVED] How to COUNTIF/LOOKUP for items that fall between two dates.
    By ScotyB in forum Excel General
    Replies: 4
    Last Post: 04-09-2012, 06:59 PM
  4. Find Standard Deviation, Do items fall in or out of Range?
    By Jimbo42 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2012, 08:19 PM
  5. [SOLVED] How to total items if they fall between a date range
    By cel in forum Excel General
    Replies: 1
    Last Post: 05-17-2005, 03:06 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