902 views
2 votes
Dean wants a quick way to look up staff members by their Staff ID.

In cell Q3, nest the existing VLOOKUP function in an IFERROR function. If the VLOOKUP function returns an error result, the text "Invalid Staff ID" should be displayed by the formula. (Hint: You can test that this formula is working by changing the value in cell Q2 to 0, but remember to set the value of cell Q2 back to 1036 when the testing is complete.)

Current cell function is =VLOOKUP(Q2,CBFStaff[[Staff ID]:[Name]],2,FALSE)

1 Answer

2 votes

Answer:

iferror(VLOOKUP(Q2,CBFStaff[[Staff ID]:[Name]],2,FALSE), "Invalid Staff ID")

Step-by-step explanation:

The vlookup formula is not given, but let me explain the general concept here,

iferror works typically like an if else statement, its syntax is IFERROR(value,value _ if _ error), if the it sequal to value, value is returned if not, the next argument is returned, so in this case, we will need to replace value with vlookup function and add an else argument like this

IFERROR(VLOOKUP(),"Invalid Staff ID")// now this will set the message if vlookup cannot find the value

User Novice C
by
4.8k points