I have an excel workbook that stores numerous worksheets containing lists of people's names. I want to add a worksheet with Last names inputted in column A, First names inputted in column B, and a function in column C that Takes the name in column A and searches all of the Last names in the rest of the workbook (accross multiple worksheets) for a match. If no match is found the cell in column C remains empty. If a match is found then the function takes the name in column B and searches all of the first names is the rest of the worksheet (accross multiple worksheets) for a match. If a match is found then the cell in column C returns: "Name Found"; otherwise it remains empty. This is the function that I have been working on, but I am new at this, and I can't quit figure it out. The function appears to run, but it returns: "#VALUE" in the cell in column C. I need help figuring out what the problem(s) is(are). This is the function as I have it:
Function CheckNames(LastName, FirstName, SearchRange1, SearchRange2)
If LastName = SearchRange1 Then
If FirstName = SearchRange1 Then
CheckNames = "Name Found"
Else
If LastName = SearchRange2 Then
If FirstName = SearchRange2 Then
CheckNames = "Name Found"
Else: CheckNames = " "
End If
End If
End If
End If
End Function
Bookmarks