# Excel 2min Tip #1: Sort data with the =RIGHT function: by David Carter

When Excel sorts a column of items, it looks at the initial character of each item, that is, the characters to the LEFT. But suppose you want to sort according to characters on the right?

For this you need to use the =RIGHT function.

Example problem:

You have a series of account codes, where the first five digits represent the nominal code, the last three digits the cost centre.

They are in cells A1:A6 and in nominal code order like this (51000-52000):

51000-100

51000-200

51000-300

52000-100

52000-200

52000-300

You want to sort them into cost centre code order like this (100, 200, 300):

51000-100

52000-100

51000-200

52000-200

51000-300

52000-300

Solution

• Create a blank column to the right of column A
• In B1 type =RIGHT(A1,3).

This will return the value 100.

Copy this fo...

The full article is available to registered AccountingWEB.co.uk members only. To read the rest of this article you’ll need to login or register. Registration is FREE and allows you to view all content, ask questions, comment and much more.