LEFT, RIGHT and MID practice exercises
Take a piece out of a text by position: the first characters, the last characters or a run from the middle, such as a prefix or a year inside a code.
- 1Take the prefix with LEFTThe first three letters of the product code in A2 name the warehouse. In B2, use LEFT to get them.
- 2Take the last digits with RIGHTPremiumIn B2, use RIGHT to get the last four characters of the invoice in A2, the running number.
- 3Take the year from the middle with MIDPremiumThe year in the invoice in A2 starts at character 5 and is 4 characters long. In B2, use MID to get it.
- 4Drop a prefix with RIGHT and LENPremiumEvery order ID starts with a 3-letter channel code, but the numbers have different lengths. In B2, take everything after the first 3 characters with RIGHT, and use LEN(A2)-3 for how many.