ISREF()

Syntax. ISREF(value)

Definition. This function returns TRUE if the value argument is a valid cell reference (address or name). Otherwise, the function returns FALSE.

Arguments

  • value (required). The expression (a number, text, a formula without an equal sign, a logical value, an error value, a reference, or a name) that you want to check

Background. This function is one of the nine IS() functions that return a logical value depending on the argument. The argument of the IS() functions is not converted for evaluation. This means that a string consisting of a number is interpreted as a string (not as a number). IS() functions are often used together with the IF() function to pre-test the result of a calculation. The result returned by an IS() function can be used as the basis for conditional formats and validation rules.

ISREF() checks whether an argument is a cell reference. Arguments such as B1 or Table1!$A$1 return TRUE even if Table1 doesn’t exist in the workbook (although Excel tries to find this table). Arguments such as -B1, 12, or A1 return FALSE.

Note

If the reference type is R1C1, addresses are interpreted as references (for example, R2C3 or R(–1)C(–2)).

Example. The following examples illustrate how to use the ISREF() function.

Modified Error Messages. Assume that you have named a range in a workbook ABC and use this name for calculations in a cell outside the range. You want to prevent the name from being inadvertently deleted. The simple formula

=AVERAGE(ABC)

can be extended to

=IF(ISREF(ABC),AVERAGE(ABC),"The name ABC was deleted")

This formula displays the custom text instead of the #NAME? error.

Caution

The ISREF() function offers some surprises. For example

=ISREF(A1)

returns the logical value TRUE, but

=ISREF(ADDRESS(1,1))

returns FALSE. The reason for this is that ADDRESS() returns the text A1 instead of a reference, and text cannot be evaluated.

See Also

ISBLANK(), ISERR(), ISERROR(), ISLOGICAL(), ISNA(), ISNONTEXT(), ISNUMBER(), ISTEXT()

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.221.144