Text function
RIGHT
Take characters from the end.
Purpose
Take characters from the end of a value
Returns
The last characters of the value, as text
Syntax
=RIGHT(text, [how_many])
| Argument | Required | What goes here |
|---|---|---|
text | Required | The cell you are taking characters from. |
how_many | Optional | How many characters to take. One if you leave it out. |
How to use RIGHT
RIGHT is LEFT from the other end: the value, and how many characters you want off the back.
It is the shortest way to get a fixed-width suffix, which on a ledger is usually the document number.
When the suffix varies in length, work out the count with LEN and FIND rather than guessing it.
Examples
Every result below is worked out by the same evaluator that marks your answers, on the sheet shown here.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Reference | Supplier name | Amount | Posted |
| 2 | GL-6100-8801 | brightwell paper | 1500 | Y |
| 3 | GL-6200-8802 | calder UTILITIES | 320 | y |
| 4 | GL-6100-8803 | meridian freight ltd | 2750 | |
| 5 | GL-6300-8804 | ashgrove catering | 184 | Y |
| 6 | GL-6200-8805 | THORNBURY print | 760 | |
| 7 | GL-6100-8806 | Brightwell Paper | 1120 | Y |
| Formula | Result |
|---|---|
=RIGHT(A2,4)The invoice number off the end of the reference. | 8801 |
=VALUE(RIGHT(A2,4))The same thing as a number, ready to be matched against a numeric invoice column. | 8801 |
=RIGHT(A2,LEN(A2)-FIND("-",A2))Everything after the first dash, however long that turns out to be. | 6100-8801 |
Notes
- A reference that has picked up a trailing space gives the wrong answer here and looks right on screen. TRIM first if the source is an import.
Related
Practise RIGHT in Unit 10
A reference tells you what it does. A unit makes you use it.