+ Reply to Thread
Results 1 to 7 of 7

sum combining data from more than one tables?

  1. #1
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    sum combining data from more than one tables?

    Hi all, i was wondering if a sumifs or other formulas (not vba) in excel 2019 can calculate a sum combining data from more than one tables:

    for example i got a table with POs with say three columns and the following dummy data:

    po id, date, customer
    po1, 1/11/2020, cus-A
    po2, 2/11/2020, cus-A
    ...

    and i got a table with PO lines with say three columns and the following dummy data:
    po id, item id, quantity
    po1, it-1, 10
    po1, it-2, 10
    po2, it-1, 5
    ...

    now i want to know how many it-2 items i sold to cus-A customer having as a "link" the po id in both tables in the example above

    any ideas/directions much appreciated
    thx!
    Attached Files Attached Files
    Last edited by S@S; 11-11-2020 at 12:07 PM.

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

    Re: sum combining data from more than one tables?

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: sum combining data from more than one tables?

    yup, example sheet attached, thx!

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: sum combining data from more than one tables?

    if POs are sorted

    =SUMPRODUCT((LOOKUP(A8:A10,A3:C4)=C3)*(B8:B10=B9),C8:C10)

    if not sort
    =SUMPRODUCT((VLOOKUP(T(IF(1,+A8:A10)),A3:C4,3,0)=C3)*(B8:B10=B9),C8:C10)
    Ctrl+Shift+Enter
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: sum combining data from more than one tables?

    in the attached, if we change C3 to cus-B

    we get cus-A, it-1 = 22 instead of 20
    looks like the "link" is not used?
    Attached Files Attached Files

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: sum combining data from more than one tables?

    Try

    =SUMPRODUCT((LOOKUP($A$8:$A$10,$A$3:$A$4,$C$3:$C$4)=E3)*($B$8:$B$10=F3),$C$8:$C$10)

    and
    =SUMPRODUCT((VLOOKUP(T(IF(1,+$A$8:$A$10)),$A$3:$C$4,3,0)=E3)*($B$8:$B$10=F3),$C$8:$C$10)
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-04-2004
    Location
    Athens
    MS-Off Ver
    2019
    Posts
    48

    Re: sum combining data from more than one tables?

    i think this looks much better not sure i understand 100% how it works but i added one more criterion to include the date in the formula:

    =SUMPRODUCT((LOOKUP($A$8:$A$10;$A$3:$A$4;$C$3:$C$4)=E6)*(LOOKUP($A$8:$A$10;$A$3:$A$4;$B$3:$B$4)>=D6)*($B$8:$B$10=F6);$C$8:$C$10)

    thx a lot!

+ 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. Combining data from two pivot tables
    By tonibinga in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-02-2020, 05:13 AM
  2. Combining the contents of two tables or sets of data.
    By JMHENDO in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-19-2020, 01:06 AM
  3. Combining data from two similar tables into one PivotChart
    By tomolias in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-27-2020, 06:39 AM
  4. [SOLVED] Combining data from multiple tables
    By Mr. Z in forum Excel General
    Replies: 3
    Last Post: 06-11-2019, 02:35 AM
  5. Replies: 4
    Last Post: 07-25-2017, 03:49 PM
  6. Combining two tables data to one chart
    By Hammond in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 04-29-2016, 12:49 PM
  7. Combining data from two tables
    By chrisd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-29-2008, 07:26 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