+ Reply to Thread
Results 1 to 5 of 5

Find list of text in row and then return offset of matched text?

  1. #1
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Find list of text in row and then return offset of matched text?

    So lets say I have a list of text I want to find in particular row: Dog, Cat, Bird, Bear

    I would need a macro to search the row for any of those values. When it finds one of those values, then I want it to put that value in the "Summary" tab in Cell B2. Then, I would need to offset the column where it found the match by the 2nd column to the right and put that value the "Summary" tab in Cell C2.

    I have attached an example workbook showing what I would need. In "Sheet1" is where I would need to do the search by row. Then on the summary tab is where I would be entering the values returned from the matches on Sheet1.

    Thanks for the help and let me know if the example workbook does not make sense.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find list of text in row and then return offset of matched text?

    It is not clear to me, why you want the data in the summary rapport like that.

    I made a pivot table (with more values), so you can see what is possible, to analyse the data, if your data is formatted the right way.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Find list of text in row and then return offset of matched text?

    Quote Originally Posted by oeldere View Post
    It is not clear to me, why you want the data in the summary rapport like that.

    I made a pivot table (with more values), so you can see what is possible, to analyse the data, if your data is formatted the right way.
    The example is just with dummy data for ease of asking the question. Row 2 will be filled with more data than what is presented in the example. But I just need to search the row to find a match from my list of values. Then once it finds that match, find other values that will be an offset of a certain amount of columns to the right. Then, put all these values in a summary on the summary tab.

    Yes, a pivot table would be easiest, however, the way the data is coming in is different for each row. So my match (bird, dog, cat, bear) could be in a different column of the row for each row. The constant is that once I find the match (bird, dog, cat, bear) the other data I need are fixed columns offset from the match. If that makes sense.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Find list of text in row and then return offset of matched text?

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 08-05-2017 at 11:44 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Find list of text in row and then return offset of matched text?

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Works perfectly! Thank you!

+ 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. Find Text in Range of Cells and Sum All Quantities for Matched Cell
    By NardoBro in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-15-2017, 04:35 PM
  2. Formula to find and return text string within a cell full of text strings
    By LightingPop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2013, 11:45 PM
  3. Replies: 2
    Last Post: 09-07-2013, 07:50 PM
  4. Replies: 7
    Last Post: 01-24-2013, 06:55 PM
  5. Replies: 2
    Last Post: 01-01-2010, 10:26 AM
  6. SUMPRODUCT two text are matched in the list
    By shahidkhaki in forum Excel General
    Replies: 4
    Last Post: 08-05-2007, 05:08 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