+ Reply to Thread
Results 1 to 7 of 7

Formula help for match to return corresponding row values

  1. #1
    Registered User
    Join Date
    12-13-2019
    Location
    Pennsylvania
    MS-Off Ver
    Office365
    Posts
    10

    Question Formula help for match to return corresponding row values

    Hi experts,
    I'm new here and not bad at Excel in general.
    I am having this issue.

    Column A - contains unit #
    Column B - contains owner
    Column C - contains customer
    Column D - contains district
    Column E - contains type
    Column F - contains date
    Column G - contains a number
    Column H - contains contact info
    Column I - contains notes

    The data above starts in row 4 and the data reaches to row 141.

    I want to search column D and if the cell value matches my supplied value, return the corresponding values of cells A-I in the row where the district shows a match.
    I need to match all values in column D and return the data to a new spreadsheet without blank spaces. In other words, match a value from column D, pull corresponding data from A,B,C,E,F,G,H and I and fill those pieces of data into a row on the new sheet while only filling as many columns as the data matched. I have been playing around and I have this formula in a cell on my new spreadsheet:
    =INDEX(A4:I4,MATCH("ETX",$D$4:$D$141,0),0)

    This works as far as pulling the data and placing it in the proper rows. But I can't seem to get it to continue looking, matching the value and bringing the remaining data from cells A:5 to I:141. I am pretty sure I need a IFERROR, AGGREGATE and a count function but alas, this seems to be over my head.

    Sample Data

    A B C D E F G H I
    _____________________________________________________________________________________________
    Unit# | Owner | Customer | District | type | date | Days passed | Contact | Notes
    4 1 M1 Brown ETX No Info No Info Trent Davis Sold
    5 2 M1 Brown WTX post job 10/8/2019 65 Richard Jones
    6 3 M1 J&K NE 6 Month 7/26/2019 139 Tyler Crow Sold
    7 4 M1 J&K NE 2 Month 4/11/2019 245 Tyler Crow
    8 5 M1 Brown ETX post job 10/10/2019 63 Trent Davis

    My formula pulls all the data from row 4 and places it in the new sheet because column D matched ETX.
    But I can't get the formula to continue. I need it to ignore any instances in column D that are not ETX and when it sees the next matching value (in this case row 8), pull the data from row 8 and place it under the previous result.

    I'm hoping somebody here can help me out.
    Best regards!
    Last edited by TheNewGuyFromPA; 12-13-2019 at 12:30 PM.

  2. #2
    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,939

    Re: Formula help for match to return corresponding row values

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  3. #3
    Registered User
    Join Date
    12-13-2019
    Location
    Pennsylvania
    MS-Off Ver
    Office365
    Posts
    10

    Re: Formula help for match to return corresponding row values

    OK, here is a sample. I have a sheet called "Main" that I want to extract only the ETX District data from.
    In my second sheet called "ETX District" I have a formula that pulls the first ETX unit info but I can't get it to find the next one in the list and return it to the next available row.

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Formula help for match to return corresponding row values

    Paste this formula into A3. This is an array formula so make sure to use CTRL SHIFT ENTER then drag down and across.


    =iferror(INDEX(Main!A$1:A$7,SMALL(IF(Main!$D$1:$D$7="ETX",ROW(Main!$D$1:$D$7)-ROW($B$1)+1),ROWS($B$1:$B1))),0)


    EDIT: Right now this goes shows that your last data row on the MAIN tab is in D7. If you have more data make sure to update the rows. accordingly

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Formula help for match to return corresponding row values

    Or you could use a pivot table. select all data in proper order, add it in the pivot, then go to Design - Subtotals do not show, Report Layout - Tabular. And filter the District column.
    Click the * to say thanks.

  6. #6
    Registered User
    Join Date
    12-13-2019
    Location
    Pennsylvania
    MS-Off Ver
    Office365
    Posts
    10

    Re: Formula help for match to return corresponding row values

    Genius, pure genius! Thanks dosydos! I've been struggling with this for a while.

  7. #7
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Formula help for match to return corresponding row values

    you're welcome, and 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. Index Macth + Hlookup?
    By Brandoeats in forum Excel General
    Replies: 3
    Last Post: 11-07-2018, 01:13 PM
  2. [SOLVED] INDEX and MACTH
    By Arafat Sarip in forum Excel General
    Replies: 6
    Last Post: 09-13-2017, 01:41 AM
  3. [SOLVED] using INDEX and MACTH in a SUMIF formula
    By moneypennie21 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-18-2014, 12:16 PM
  4. Macth, Index or Vlookup?
    By jasonjholt in forum Excel General
    Replies: 7
    Last Post: 03-12-2014, 01:04 PM
  5. [SOLVED] Index Indirect macth
    By namluke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-12-2013, 11:29 AM
  6. To show Yes in the Macth Column
    By meetvivek72 in forum Excel General
    Replies: 4
    Last Post: 04-04-2012, 09:23 AM
  7. Replies: 7
    Last Post: 09-15-2008, 04:03 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