+ Reply to Thread
Results 1 to 7 of 7

Need Help Retrieving Values from Columns

  1. #1
    Registered User
    Join Date
    08-11-2016
    Location
    New York
    MS-Off Ver
    2013
    Posts
    78

    Need Help Retrieving Values from Columns

    Hello,

    I'm stuck in a bit of an problem and hoping someone could shine a light on this...The problem is I'm trying to figure out a method to find the value that matches in a column and if it matches the table then return that value in column B. The problem is that within a given row there could be multiple values that may match the values in the reference table so I would like to find a method that would return multiple values in a list format. I provided an example in a spreadsheet file and the goal I'm hoping to achieve as well, Any help would be greatly appreciated!

    Thanks for any help!
    Attached Files Attached Files

  2. #2
    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 Retrieving Values from Columns

    Hi,

    You'd be better advised to record your data in a normalised 2 dimensional table. See Sheet 2 in the attached.
    This allows you to use a Pivot Table to analyse your data and avids the need for formulae or VBA altogether. I've also added a SLicer to allow you to filter the PT for particular subjects.
    Attached Files Attached Files
    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.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Need Help Retrieving Values from Columns

    Here is a VBA solution

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    08-11-2016
    Location
    New York
    MS-Off Ver
    2013
    Posts
    78

    Re: Need Help Retrieving Values from Columns

    Thanks for your help on this problem,

    1) Thank you Richard for taking a look at this the only problem with the solution you provided is that that example is actually part of a bigger table which I cannot change because it's part of a bigger spreadsheet..

    2) Thank you alansidman for taking a look as well this solution is more in line for what I'm looking for...A few questions concerning this code..First is there a way to remove the ";" in front of the first keyword for example, (;class1; class2). In addition if the ref table is on a different workbook how would I reference it in the vba code for example if the ref table was in a worksheet called "Values for Table.xls" and the table was located from A2:B9? Thanks again!

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Need Help Retrieving Values from Columns

    As to the ";"you have a choice. Either the way it is or just a space and no punctuation. I have changed it so that there is only a space and no punctuation.

    As to the look up table, the below code should work so long as both workbooks are open
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-11-2016
    Location
    New York
    MS-Off Ver
    2013
    Posts
    78

    Re: Need Help Retrieving Values from Columns

    Thanks alansidman! This works like a charm! Thanks for your help with this!

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Need Help Retrieving Values from Columns

    You are welcome. Thanks for the Rep

+ 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. Retrieving data table with 3 columns
    By MrJayB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2017, 02:02 PM
  2. [SOLVED] Need help retrieving only values greater than 1 lac values in a column
    By msb15 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2017, 02:24 PM
  3. [SOLVED] Retrieving first, second and following numerical values of multiple columns
    By Nbisgaard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-17-2015, 02:25 AM
  4. Finding & Retrieving words from columns
    By pablowilks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2015, 09:31 AM
  5. Retrieving cells from different columns to a new table
    By maherbeik in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-29-2013, 02:14 PM
  6. Replies: 8
    Last Post: 05-20-2011, 11:36 AM
  7. Replies: 0
    Last Post: 08-25-2005, 02:17 AM

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