Forum Discussion

evitajere's avatar
evitajere
Copper Contributor
Sep 21, 2020

Lookup iferror, index/match errors

In the Workers Register- employees are segmented according to worker type,  department and role. Depending on the department selcted- employee names are selected from a list. Fields such as employee number, employee status etc are supposed to be filled automatically depending on the position table the employee is stored in (that is multiple tables searched depending on selection)

 

The formula I used after searching through countless forums is returning the error "you have entered too many/few arguments for this function." Please help me fix it.

10 Replies

  • Lewis-H's avatar
    Lewis-H
    Iron Contributor

    Using the IFEEROR, INDEX and MATCH Formula
    We want to get a product description in the cell F3, from the lookup table H3:I9, based on the Product ID 103 in the cell C3. If Product ID 103 is not found in the lookup table, we want to return “Description missing” in F3.

    The formula looks like:

    =IFERROR(INDEX($H$3:$I$9, MATCH(C3, $H$3:$H$9, 0), 2), “Description missing”)

    The lookup_value parameter of the MATCH function is C3. The lookup_array is $H$3:$H$9, while the match_type is 0, as we want the exact match. The result of the MATCH function is the row_num parameter of the INDEX function. The array the range $H$3:$I$9. Finally, the value parameter of the IFERROR function is the result of the INDEX function, while the value_if_error is “Description missing”.

    To apply the formula, we need to follow these steps:

    Select cell F3 and click on it
    Insert the formula: =IFERROR(INDEX($H$3:$I$9, MATCH(C3, $H$3:$H$9, 0), 2), "Description missing")
    Press enter
    Drag the formula down to the other cells in the column by clicking and dragging the little “+” icon at the bottom-right of the cell.

    • SergeiBaklan's avatar
      SergeiBaklan
      Diamond Contributor

      Lewis-H 

      For this concrete example I'd recommend

      =IFERROR(INDEX($I$3:$I$9, MATCH(C3, $H$3:$H$9, 0)), “Description missing”)

      Why to replicate the weakness of VLOOKUP()?

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    evitajere 

    Data structure is too complicated. For this one it could be

    =IFNA(INDEX(INDEX('Dropdown Lists'!$A$1:$AH$16,0,MATCH([@Position],'Dropdown Lists'!$A$1:$AH$1,0)+2),
                 MATCH([@Name],INDEX('Dropdown Lists'!$A$1:$AH$16,0,MATCH([@Position],'Dropdown Lists'!$A$1:$AH$1,0)),0),1
    ),"not found")
    • evitajere's avatar
      evitajere
      Copper Contributor

      Interesting SergeiBaklan I've never come across the IFNA function before!

       

      Still, see the attached screenshot when I enter the formula. Its returning #NAME? instead. What could I be doing wrong?

Resources