IFERROR,索引匹配公式,有太多的争论

时间:2015-06-30 09:16:26

标签: excel indexing

我正在尝试根据客户编号在26页spreedsheet中查找数据。每张纸都标有一个字母来组织姓氏。每张表都有下表:

Surname | Forename | Client Number | Daily Ticket Count | Monthly Ticket Count |
Ticket No | Date | Ticket No2 | Date | Ticket No3 | Date | Ticket No4 | Date | 
Ticket No 5 | Date

我按客户编号搜索所有已分配的门票。下面这个公式只是检查Ticket No,然后在另一个单元格中有另一个公式来搜索Ticket No2。门票3到5重复。

这是我目前的公式。我打算为每张A-Z完全重复这一点,但这显然不可行。是否可以通过使用另一个函数来执行此操作,如果可以,还有什么功能?

=IFERROR(INDEX(A!F2:F36,(MATCH($B12,A!C2:C36,0))),INDEX(B!F2:F36,(MATCH($B12,B!C2:C36,0))),
 INDEX(C!F2:F36,(MATCH($B12,C!C2:C36,0))))

2 个答案:

答案 0 :(得分:0)

有什么问题
=IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(VLOOKUP($B12,A!C:F,4,FALSE),VLOOKUP($B12,B!C:F,4,FALSE)),VLOOKUP($B12,C!C:F,4,FALSE)),VLOOKUP($B12,D!C:F,4,FALSE)),VLOOKUP($B12,E!C:F,4,FALSE)),VLOOKUP($B12,F!C:F,4,FALSE)),VLOOKUP($B12,G!C:F,4,FALSE)),VLOOKUP($B12,H!C:F,4,FALSE)),VLOOKUP($B12,I!C:F,4,FALSE)),VLOOKUP($B12,J!C:F,4,FALSE)),VLOOKUP($B12,K!C:F,4,FALSE)),VLOOKUP($B12,L!C:F,4,FALSE)),VLOOKUP($B12,M!C:F,4,FALSE)),VLOOKUP($B12,N!C:F,4,FALSE)),VLOOKUP($B12,O!C:F,4,FALSE)),VLOOKUP($B12,P!C:F,4,FALSE)),VLOOKUP($B12,Q!C:F,4,FALSE)),VLOOKUP($B12,R!C:F,4,FALSE)),VLOOKUP($B12,S!C:F,4,FALSE)),VLOOKUP($B12,T!C:F,4,FALSE)),VLOOKUP($B12,U!C:F,4,FALSE)),VLOOKUP($B12,V!C:F,4,FALSE)),VLOOKUP($B12,W!C:F,4,FALSE)),VLOOKUP($B12,X!C:F,4,FALSE)),VLOOKUP($B12,Y!C:F,4,FALSE)),VLOOKUP($B12,Z!C:F,4,FALSE))

答案 1 :(得分:0)

Here's a VBA solution for the same task, for you it's =ertdfgcvb($B12,C1;F1;Arry1) where Arry1 is a range that contains the sheet names, in your preference order.

Public Function ertdfgcvb(Lookup_val As Variant, Lookup_col As Range, Grab_col As Range, ShtArr As Range)
Dim ws As Worksheet, rng As Range

Find1 = Lookup_col.Column
Grab1 = Grab_col.Column

On Error Resume Next
For Each rng In ShtArr
    Set ws = Sheets(rng.Value2)
    ertdfgcvb = Application.WorksheetFunction.VLookup(Lookup_val, ws.Columns(Find1), ws.Columns(Grab1))
    Exit Function
Next
End Function