+ Reply to Thread
Results 1 to 17 of 17

compare Two Tables - A and B - and Return the Values of Table A

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    compare Two Tables - A and B - and Return the Values of Table A

    Hi

    This is my second post on the same matter.
    I need to compare the values of two tables and return the values of table A. However, some identifiers in table A repeats twice or more.
    On my first post, Sambo Kid provided the formula =IFERROR(VLOOKUP($F2,$A:$D,COLUMN(B$1),FALSE),""), which partially worked, because the second instance where the identifier repeats the formula doesn't return its second instance.
    A copy of the spreadsheet is attached.
    Thank you for the help again.
    Attached Files Attached Files
    Last edited by Alienontherun; 08-28-2018 at 06:05 AM.

  2. #2
    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: compare Two Tables - A and B - and Return the Values of Table A

    Attach the file directly here, please.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    VLOOKUP is designed only to return the first matching value it finds.
    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.

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    It doesn't work, I don't know if it is my browwer, sorry.

  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: compare Two Tables - A and B - and Return the Values of Table A

    Yes, it does. Don't try to use the paperclip icon - follow my instructions.

  5. #5
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    Got it, thank you.

  6. #6
    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: compare Two Tables - A and B - and Return the Values of Table A

    Thanks!

    I don't understand the data - is this a before and after? I can't see the formula anywhere.

  7. #7
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    Quote Originally Posted by AliGW View Post
    VLOOKUP is designed only to return the first matching value it finds.
    I thought the same thing about VLOOKUP, too.
    Last edited by AliGW; 08-28-2018 at 06:14 AM.

  8. #8
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    I didn't apply the formulat to that spreadsheet that I attached. But if you do it, you will notice that that formula will not reutrn any repeated instance where the product code repeats.

  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: compare Two Tables - A and B - and Return the Values of Table A

    Yes, but where should I apply it? You have not yet properly explained the two datasets in the attachment. Remember you know what it all means and how it relates - I don't (yet).

  10. #10
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    Sorry, I have applied the formula on the spreadsheet. Please see attached.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    Hi Ali

    As I said I applied the formula to the spreadsheet.
    I want the stock level figures in column B of Table A to be returned according to the Code. However, in Table A, the code sometimes repeats twice, hence only the first instance of the code that repeats is being returned, rather than the sum of the stock level of the code that repeats twice.

    Also, the stock level figure is supposed to be placed in the same row as the matching code of Table B.

    Please let me know if you have any doubt.

    Thank you.
    Last edited by Alienontherun; 08-28-2018 at 11:07 AM.

  12. #12
    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: compare Two Tables - A and B - and Return the Values of Table A

    Sorry - I have been busy working and not yet had the opportunity to have a look. I'll have a quick look now.

  13. #13
    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: compare Two Tables - A and B - and Return the Values of Table A

    I think this is what you need:

    =IFERROR(SUMIF($A$3:$A$134,F3,$B$3:$B$134),"")

  14. #14
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    Quote Originally Posted by AliGW View Post
    I think this is what you need:

    =IFERROR(SUMIF($A$3:$A$134,F3,$B$3:$B$134),"")
    S t o n k i n g! You nailed it! Thank you!

  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: compare Two Tables - A and B - and Return the Values of Table A

    Glad to have helped!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  16. #16
    Registered User
    Join Date
    06-21-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    48

    Re: compare Two Tables - A and B - and Return the Values of Table A

    I will do, reputation added to you too.

  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: compare Two Tables - A and B - and Return the Values of Table A

    Kind of you - thanks. Not really that impressive - SUMIF and SUMIFS are pretty run-of-the-mill. You might want to read up on COUNTIF/COUNTIFS and as you have 365, AVERAGEIF/AVERAGEIFS as well. All very handy!

+ 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] Compare Two Tables and Return Values Only on Rows that Match the other Table
    By Alienontherun in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-27-2018, 06:41 AM
  2. Replies: 1
    Last Post: 07-07-2018, 02:52 AM
  3. Replies: 20
    Last Post: 10-16-2015, 09:56 AM
  4. Replies: 2
    Last Post: 07-18-2015, 05:19 PM
  5. Compare position in two tables and return a value
    By remetiffy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-03-2012, 07:23 PM
  6. Excel 2007 : Compare two tables, return diferences
    By dancing-shadow in forum Excel General
    Replies: 1
    Last Post: 03-09-2011, 09:26 AM
  7. Need to compare 2 tables to generate 3rd table
    By Kevin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2005, 06:05 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