+ Reply to Thread
Results 1 to 2 of 2

Need to Pull multiple rows from table using the same Primary Key

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    Newark, Delaware
    MS-Off Ver
    Excel 2010
    Posts
    1

    Need to Pull multiple rows from table using the same Primary Key

    I've tried searching but I can't figure out the best approach. I want to figure out how to dynamically fill in a receipt template by changing the order number value and having the data filled in in the order detail on the receipt. I've tried vlookup but it only pulls the first row with that Order ID

    The data that it's being pulled from could have multiple rows with the same order ID. The way I have the formula now works great, except if there are multiple orders with the same amount of rows because it matches row numbers instead of matching by the order ID.

    Anyway, i'm sure it's simple but i'm stumped, any help would be greatly appreciated. I attached the file i'm working with.

    Sales receipt1.xlsx

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Need to Pull multiple rows from table using the same Primary Key

    I changed the column headers on sheet1 to correspond to the sales receipt headers. Then:
    A17:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It looks for the matching column header, then goes down to matching receipt number adjusted by row (i.e. the first line item on the receipt is in row 17, so the adjustment, ROW()-17 is zero rows from the sheet1 match.
    Attached Files Attached Files
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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