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.

Continued...

» Register now

The full article is available to registered AccountingWEB 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.

Comments

a little less brittle ....

Anonymous | | Permalink

A robuster formula that would handle the case where the reference before the "-" was of variable length would be :
=right(A1,len(A1)-find("-",a1)).

As a by-product it would also handle the case where the reference after the "-" was also of variable length