+ Reply to Thread
Results 1 to 10 of 10

Finding & Matching Values Then Returning Sum

  1. #1
    Registered User
    Join Date
    04-23-2019
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    17

    Finding & Matching Values Then Returning Sum

    Hi, newbie here. Thanks in advance for the help.

    My question is in using matching or vlookup or hlookup? Am not so sure. I have two spreadsheet tabs. I want to fill up the "Current Stock Count" in first spreadsheet tab, where the product name and variation name will be searched in second spreadsheet, and add up quantity sold for that item, then the total quantity sold will be deducted from the Initial Inventory. How to formulate the code to get the result?

    Again, thank you.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: Finding & Matching Values Then Returning Sum

    I think all you need in E3 is: =D3-SUMPRODUCT((B3='Tab 2'!B$3:B$10)*(C3='Tab 2'!C$3:C$10)*'Tab 2'!E$3:E$10)

  3. #3
    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,926

    Re: Finding & Matching Values Then Returning Sum

    While SUMPRODUCT is not wrong, it can become very inefficient if used on large quantities of data, try this instead...
    =D3-SUMIFS('Tab 2'!$E$3:$E$10,'Tab 2'!$B$3:$B$10,'Tab 1'!B3,'Tab 2'!$C$3:$C$10,'Tab 1'!C3)
    copied down
    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

  4. #4
    Registered User
    Join Date
    04-23-2019
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    17

    Re: Finding & Matching Values Then Returning Sum

    Thank you so much for both your help!

    I just have a question though.. On code =D3-SUMPRODUCT((B3='Tab 2'!B$3:B$10)*(C3='Tab 2'!C$3:C$10)*'Tab 2'!E$3:E$10)
    The entry which has no variation detail is returning a wrong number.. How to solve this? Thanks!

  5. #5
    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,926

    Re: Finding & Matching Values Then Returning Sum

    Did you try the SUMIFS version?

  6. #6
    Registered User
    Join Date
    04-23-2019
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    17

    Re: Finding & Matching Values Then Returning Sum

    Hi. Yes. I used the SUMIF version. It's okay, I just put "none" for those items with no variation names. And it works fine. Thanks!

  7. #7
    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,926

    Re: Finding & Matching Values Then Returning Sum

    OK, happy to help

  8. #8
    Registered User
    Join Date
    04-23-2019
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    17

    Re: Finding & Matching Values Then Returning Sum

    Hello again. Would like to ask for a quick help on how to formulate to return the cost? I have 2 tabs. Would like for it to check and match both product name and variation name. (even though cost is same)

    firsts.png

    seconds.png


    Thank you so much.
    Last edited by justgeminime; 11-03-2021 at 12:40 PM.

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

    Re: Finding & Matching Values Then Returning Sum

    You should be able to use the exact same sumifS() function for that. Give it a try and let me know how you make out.

  10. #10
    Registered User
    Join Date
    04-23-2019
    Location
    Philippines
    MS-Off Ver
    2021
    Posts
    17

    Re: Finding & Matching Values Then Returning Sum

    For this case, i didn't actually need any sum... so upon searching online for some formulas, i just used Index Match. and so far working okay. TY

+ 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. Looping through rows, finding 2 matching columns, returning the 3rd column as a variable
    By orionanomaly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2018, 09:36 AM
  2. Matching and returning a range of values
    By paliatso in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-03-2018, 06:18 PM
  3. Replies: 3
    Last Post: 05-21-2015, 05:27 AM
  4. Finding matching cells then returning data of another cell
    By GenericPat in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-19-2012, 03:36 PM
  5. Replies: 1
    Last Post: 12-28-2010, 01:44 PM
  6. Finding a matching value & returning another value
    By JJanssen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2009, 06:19 PM
  7. [SOLVED] Matching values & returning on the same row
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2005, 09:06 PM

Tags for this Thread

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