SUBSTR
Syntax
SUBSTR(<string>; <start number> [; <length>])
Description
Returns a specific number of characters from a text string starting at the position you specify. If no length is specified, the rest of the string is returned. The first value in a string has the start number of 0.
When a string value is evaluated by the function, and no characters can be returned, the returned value is an empty string.
When a null value is evaluated by the function, the returned value is null.
Examples
=SUBSTR(#Sheet1!B;4;3) returns the next three characters in a string starting with the fifth character =SUBSTR(null;0,1) returns null
Column1 | Start number | SUBSTR returns |
---|---|---|
Admin-Annabelle | 6 | Annabelle |
Admin-Mark | 6 | Mark |
Admin-Lucy | 5 | -Lucy |
Admin-Joshua | 6;4 | Josh |
Admin-Joshua | 0;5 | Admin |
Admin-Maria | 11 | |
<null> | 6 | <null> |