+ Reply to Thread
Results 1 to 13 of 13

Need help with INDEX,MATCH & SUM formula

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Need help with INDEX,MATCH & SUM formula

    Hello:

    Please refer to the attached sheet with sample data.
    Sheet1 has some data which is used in Sheet2 to Summarize the quantity of each item used.

    I am using formula
    Please Login or Register  to view this content.
    The result i wanted to see was -2+7=+5 in cell D5 of sheet2.
    I am not sure if this formula is wrong.
    Please help correct the formula which is in cell D4:D

    Please let me know if any questions.

    Thank you

    Riz Momin
    Attached Files Attached Files
    Last edited by rizmomin; 09-07-2013 at 05:30 PM.

  2. #2
    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: Need help with INDEX,MATCH & SUM formula

    Try this: Enter in D4 and drag formula down

    =SUMPRODUCT((Sheet1!$D$3:$D$5=A4)*(Sheet1!$A$3:$A$5=Sheet2!$A$1)*(Sheet1!$G$3:$G$5))
    Last edited by AlKey; 09-07-2013 at 04:07 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

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help with INDEX,MATCH & SUM formula

    Hi If you're trying to sum by date and Item, # then why not simply

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need help with INDEX,MATCH & SUM formula

    you could just use sumif
    =SUMIF(Sheet1!$D$3:$D$5,A4,Sheet1!$G$3:$G$5)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need help with INDEX,MATCH & SUM formula

    Try it like this...

    =SUMIFS(Sheet1!$G$1:$G$20,Sheet1!$E$1:$E$20,D$2,Sheet1!$D$1:$D$20,$A5,Sheet1!$A$1:$A$20,$A$1)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,720

    Re: Need help with INDEX,MATCH & SUM formula

    Even though that is an array formula, MATCH will still only return the first row where it finds a match, and so the formula will only return the first value where there is a match. I think you want SUMPRODUCT or SUMIFS (would be quicker) like this:

    =SUMIFS(Sheet1!$G$1:$G$20000,Sheet1!$E$1:$E$20000,D$2,Sheet1!$D$1:$D$20000,$A4,Sheet1!$A$1:$A$20000,$A$1)

    then copy down.

    Hope this helps.

    Pete

    EDIT: Wow, I didn't expect so many people to be active on a Saturday evening!! (Well, here in the UK it is)

    Pete
    Last edited by Pete_UK; 09-07-2013 at 04:15 PM.

  7. #7
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Need help with INDEX,MATCH & SUM formula

    Hi Pete_UK:

    Your formula works great.
    How would i modify so to ignore if result is zero.
    Basically, i only want to see if result is not zero

    Thank you

    Riz Momin

  8. #8
    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: Need help with INDEX,MATCH & SUM formula

    This will show blanks instead of 0.

    =IF(SUMPRODUCT((Sheet1!$D$3:$D$5=A4)*(Sheet1!$A$3:$A$5=Sheet2!$A$1)*(Sheet1!$G$3:$G$5))=0,"",SUMPRODUCT((Sheet1!$D$3:$D$5=A4)*(Sheet1!$A$3:$A$5=Sheet2!$A$1)*(Sheet1!$G$3:$G$5)))

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Need help with INDEX,MATCH & SUM formula

    Hi AlKey:

    Thanks a lot to both of you for great help.

    Riz Momin

  10. #10
    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: Need help with INDEX,MATCH & SUM formula

    You're Welcome!

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,720

    Re: Need help with INDEX,MATCH & SUM formula

    Yeah, basically you could do:

    =IF(your_formula=0,"",your_formula)

    Another approach, though, is to use conditional formatting, set such that if the value in the cell is zero then the foreground colour is set to the background colour. The zero is still there, it's just that you don't see it.

    A third approach is to apply a Custom Format to the cells of:

    General;General;

    This also prevents the zero from being displayed.

    Hope this helps.

    Pete

  12. #12
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Need help with INDEX,MATCH & SUM formula

    Hi Pete_UK:

    You are super exceler!!!!!!!!!!!!!!

    Thanks

    Riz Momin

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need help with INDEX,MATCH & SUM formula

    Try this tweak to Pete's formula...

    =IFERROR(1/(1/SUMIFS(Sheet1!$G$1:$G$20000,Sheet1!$E$1:$E$20000,D$2,Sheet1!$D$1:$D$20000,$A4,Sheet1!$A$1:$A$20000,$A$1)),"")

+ 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. [SOLVED] Formula that counts rows that match 2 criteria, but do not match another
    By VivatMartin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 07:43 AM
  2. Replies: 5
    Last Post: 02-29-2012, 08:51 PM
  3. Replies: 2
    Last Post: 12-09-2011, 07:17 PM
  4. Nested Match(index()) vs. Match() array formula.
    By GeneralDisarray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2011, 07:57 AM
  5. Adding a third match to an Index Match Formula
    By Weasel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2009, 01:51 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