Friday, 9 August 2013

Excel's Find function; Exceptions over values

Excel's Find function; Exceptions over values

I recently learned that Excel's Find function returns a #VALUE error when
it doesn't find the needle in the haystack (i.e. no match is found). I
have several questions about this behavior:
Is there another Excel function that works as Find but returns an actual
value (e.g. -1) when no match is found?
Is there any well-known reason for the function having that behavior? I
mean, talking about general programming and software design, Is there a
known pattern (or methodology, or design philosophy) that prefers throwing
exceptions over returning values (like -1, 0, "" or similar) when a
function doesn't return a "valid" value?

No comments:

Post a Comment