Forum Discussion

Regina_Henschel's avatar
Regina_Henschel
Copper Contributor
Mar 13, 2026

Looking for use cases of function TYPE

What do you use the TYPE function for? I’m not looking for a general explanation of what the TYPE function can do—I already know that. For example, why do you use the TYPE function instead of functions like ISTEXT, ISERROR, etc.? Or, how do you interpret the result of the TYPE function?

1 Reply

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    TYPE is helpful for two things mostly:

    64 - array detection (can also use ROWS and COLUMNS for dimension check)

    128 - compound data

     

    This is a basic example of using TYPE to validate the function input of a Lambda:

    MyLambda=
    LAMBDA(
        array,
        [function],
    LET(
        // Check optional function input, default to SUM if omitted
        function,   IF(ISOMITTED(function),SUM,function),
    
        // Compound data - TYPE = 128 - valid function
        InValidFn?, TYPE(function) <> 128,
    
        // Halt function if supplied function is invalid
        IF(InValidFn?,"#INVALID-FUNCTION!",function(array))));
    
    // Sheet level formula: =MyLambda(arr,AVERAGE)