CELLTYPE
CELL(rgeCell)
Returns a single-letter code describing the type of content in a cell.
"B" - Blank cell
"T" - Text (string)
"V" - Value (numeric)
"F" - Formula (any formula, regardless of result)
"E" - Error value (e.g., #N/A, #VALUE!)
This made it much easier to test cell types in formulas without writing VBA or using complex combinations of ISTEXT, ISNUMBER, ISFORMULA, etc.
=IF(CELLTYPE(A1)="F","Formula used","Hard-typed value")
Built-in CELL does something similar but it has some limitations
It cannot distinguish formulas from numbers - A formula returning a number is still "v".
It cannot detect errors directly - You must wrap it in ISERROR.
It cannot distinguish formulas returning text vs numbers - Everything collapses into "l" or "v".
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext