Try either of the following code (using excel vba as a "sub" or within the worksheet as a "function"):
Function Code:
Function Test02(name01 As String, MaxDate As Range, MinDate As Range, Rng01 As Range)
'Rng01 Column 1 = "Date"
'Rng01 Column 2 = "jonjon"
'Rng01 Column 3 = "mtce"
Dim Arr01 As Variant ' Array of data
Dim i01 As Long 'Counter
Dim Temp01 As String 'saves the current "mtce" until a larger date is found
Dim TempDate
TempDate = 0
Arr01 = Rng01
For i01 = 1 To UBound(Arr01, 1)
If Arr01(i01, 1) < MaxDate And Arr01(i01, 1) > MinDate And Arr01(i01, 2) = name01 And TempDate < Arr01(i01, 1) Then
Test02 = Arr01(i01, 3)
TempDate = Arr01(i01, 1)
End If
Next i01
End Sub
Instead of having a function, you could use a "Sub" instead and only run it when there is an update, and keep the outputs as static strings.) You might have to edit the following code to repeat over the whole data set, but this should be a good start. If you could give me a better snapshot of how the data is laid out, I might be able to write this code this for you (if this is what you want).
This would be the basis of the sub:
Sub Test01()
Dim Arr01 As Variant ' Array of data
Dim i01 As Long 'Counter
Dim Temp01 As String 'saves the current "mtce" until a larger date is found
Dim TempDate
'Rng01 Column 1 = "Date"
'Rng01 Column 2 = "jonjon"
'Rng01 Column 3 = "mtce"
MinDate = Range("H2")
MaxDate = Range("H3")
name01 = Range("H4")
Rng01 = Range("A1:C8")
TempDate = 0
Arr01 = Rng01
For i01 = 1 To UBound(Arr01, 1)
If Arr01(i01, 1) < MaxDate And Arr01(i01, 1) > MinDate And Arr01(i01, 2) = name01 And TempDate < Arr01(i01, 1) Then
Temp01 = Arr01(i01, 3)
TempDate = Arr01(i01, 1)
End If
Next i01
Range("H5") = Temp01
End Sub