View Single Post
  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Biff wrote...
Array entered:

=INDEX(Version,MATCH(MAX(IF(File_Name="Test File 1.txt",Date_Val)),
Date_Val,0))

....

LOOKUP wouldn't need array entry.

=LOOKUP(2,1/(File_Name="Test File 1.txt")
/(Date_Val=MAX(((File_Name="Test File 1.txt"))*Date_Val)),Version)

Also, you've got a bug in your formula. If any files appeared before
'Test File 1.txt' and some versions of those preceding files had the
same date as the latest version of 'Test File 1.txt', then your formula
would return the version from the topmost other file with that date.
For example,

FileName Version Date
foobar 1 8/22/2005
foobar 2 8/23/2005
foobar 3 8/24/2005
Test File 1.txt 1 8/17/2005
Test File 1.txt 2 8/24/2005

Your formula would return 3, not 2. In order to avoid that problem,
your INDEX formula would need to be revised as

=INDEX(Version,MATCH(MAX(IF(File_Name="Test File 1.txt",Date_Val)),
IF(File_Name="Test File 1.txt",Date_Val),0))

At this point the LOOKUP formula is shorter, and it doesn't need array
entry.