Text function

LEFT

Take characters from the start.

Purpose

Take characters from the start of a value

Returns

The first characters of the value, as text

Syntax

=LEFT(text, [how_many])

ArgumentRequiredWhat goes here
textRequiredThe cell you are taking characters from.
how_manyOptionalHow many characters to take. One if you leave it out.

How to use LEFT

LEFT takes the value and how many characters you want from the front. Leave the count out and you get one character.

A fixed count is fine for a prefix that is always the same width, like the two-letter ledger tag on a reference.

For anything that varies, cut at a marker instead: FIND the separator and take one character fewer than its position.

Examples

Every result below is worked out by the same evaluator that marks your answers, on the sheet shown here.

Supplier import — raw.xlsxSheet1
A supplier export before anyone has cleaned it: padded names, a code buried in a reference, and amounts that arrived as text
ABCD
1ReferenceSupplier nameAmountPosted
2GL-6100-8801 brightwell paper 1500Y
3GL-6200-8802calder UTILITIES320y
4GL-6100-8803meridian freight ltd2750
5GL-6300-8804 ashgrove catering184Y
6GL-6200-8805THORNBURY print760
7GL-6100-8806Brightwell Paper1120Y
FormulaResult
=LEFT(A2,2)The ledger prefix, always two characters.GL
=LEFT(A2,FIND("-",A2)-1)The same answer without assuming the width. This is the version that survives a new reference format.GL
=LEFT(A2,7)Prefix and account code together, if what you want is the whole stem.GL-6100

Notes

  • Asking for more characters than the value holds gives the whole value rather than an error.
  • LEFT returns text. Wrap it in VALUE if the result has to behave as a number.
Practise LEFT in Unit 10

A reference tells you what it does. A unit makes you use it.