I have a .txt file I am importing to an excel spread sheet. I have made a page that indexes and matches the values in the sheet and displays the information in a user form type of environment based on the selected value such as "Name".

=INDEX(sheet2!A:A,MATCH($A$2,sheet2!$CB:$CB,),MATCH(A3,sheet2!A:A,))

The name is then matched and the other pertinent data is displayed.

The issue I have is the the text file is not always in order and sometimes columns may be missing. When this happens of course my references become inaccurate and all is lost.

Is there a formula or way to put these items, upon import, in the correct columns or to use a dynamic reference to find the data and place it appropriately?

Thank You