通过两个标准(x,y)查找表中的值

我被问到如何在一个表中find与两个标准相对应的值。 表格样本:

在这里输入图像说明

这是我的答案,其中=findval(3200,100)返回4,6

 Function findval(x As String, y As String) Dim LastRow As Long Dim LastCol As Integer Dim x_rgn As Range Dim y_rgn As Range With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row End With With ActiveSheet LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column End With Set x_rgn = Range(Cells(1, 1), Cells(1, LastCol)) Set y_rgn = Range(Cells(1, 1), Cells(LastRow, 1)) With x_rgn Set val_x = .Find(What:=x, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) val_x = val_x.Address val_x = Range(val_x).Column End With With y_rgn Set val_y = .Find(What:=y, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) val_y = val_y.Address val_y = Range(val_y).Row End With findval = Cells(val_y, val_x).Value End Function 

有没有更好的办法?

假设I2为3200 ,J2为100 ,则较短:

 =INDEX(A1:G8,MATCH(J2,A:A,0),MATCH(I2,1:1,0))