Originally Posted by
Pete_UK
What you need to do is establish a unique reference for each record, but to link that reference to the order number. One way of doing that is to insert a new column A (so that you can use VLOOKUP), and then in A1 you can have a formula like this:
=IF(B1="","-",B1&"_"&COUNTIF(B$1:B1,B1))
Then you can copy this down way beyond the data that you currently have (the hyphens will show you where you have copied it to) so that you can cope with new data being added. You can hide this column if you want to, so that the sheet looks the same as before.
Then in your VLOOKUP formula you have to address a larger table so that you include the new column A, and instead of looking up a particular order number, you have to tag on that sequential count that has now been set up in the new column A. So, assuming the order number that you are looking for is in cell A1 of the Invoice sheet, your formula will be something like this:
=IFERROR(VLOOKUP($A$1&"_"&ROWS($1:1),Orders!A:E,5,0),"")
and this can now be copied down until you start to get blanks, and it will return successive records for that order number from the fourth column of your (old) database - actually column E in the new one.
Hope this helps.
Pete
Bookmarks