title: How to compare names in MS Excel 2010 with filenames?
body: <p>My goal: to compare the filenames in a directory with the names in a spreadsheet. If there is a match, then I wish to append the corresponding account number of that name to the filename.</p>
  
  <p>I have used the dir command to retrieve all of the filenames in a directory, then pasted the list into a column in the Excel spreadsheet.</p>
  
  <p>I now have 4 columns: Account number, LastName, FirstName, and filename. The main problem here is that the filenames are inconsistent. They're in the form of "lastname, firstname date", but they vary in the forms of "Smith, John 010112", "Smith, J. 010112", "Smith J 010112". This means that when it comes to the first name, I'll only be comparing the first letter of the string.</p>
  
  <p>So essentially, for each filename I need to check the lastname against the lastname column. If a match is found, then I need to check the first letter of the filename's firstname against the first letter of the firstname in the same row as the matching lastname. If this is also a match, then I need to grab the account number in that row and append it to the filename. </p>
  
  <p>How could I do this? I'm pretty new to Excel functions, but I do have a little experience with coding in Java and C from some college classes.</p>