LEFT
LEFT(text, count)
Gives the first few characters of a piece of text, such as the area prefix at the start of a task code. It takes text only: a number, a duration or a date has to be turned into text with TEXT first, and a blank stays blank rather than becoming empty text.
Arguments
| Argument | What to give it |
|---|---|
| text | Text, like [Task code], [Name] or an attribute. A status or other choice field works too. Blank gives blank. |
| count | How many characters, a number. Leave it out for one character. More characters than the text has gives the whole text; a fraction is cut down to a whole number. |
Examples
Formula=LEFT([Task code], 3)
The first three characters of the task code: the area or system prefix when your codes are built that way.
Formula=EVERY(LEFT(Predecessors[Task code], 3) = LEFT([Task code], 3))
TRUE when every predecessor's code starts with the same three characters as the task's own: as a guardrail, it flags logic that crosses areas.
Formula on resources=UPPER(LEFT([Name], 3))
On a resource: the first three letters of its name in capitals, as a short tag.
Reach for something else when
| You want | Use |
|---|---|
| The last characters | RIGHT |
| Characters from the middle | MID |
| The part before a delimiter, however long | TEXTBEFORE: TEXTBEFORE([Name], " - ") |
| Whether the text begins with something | STARTSWITH, which also ignores case |
| A date or number shown as text first | TEXT |
Common questions
Why does LEFT of a number say "argument 1 can't be Number"?
The editor shows LEFT(text, count): argument 1 can't be Number because text never becomes a number, or a number text, on its own. Turn it into text first: LEFT(TEXT([% complete]), 1).
=LEFT([% complete], 2)
