Forum Discussion
how to sort Total exp column in an excel sheet which has in format XXYears XXMonths
Vijayvr If you have an older version of Excel (non-MS365), try the following formula for the first record in row 2, then copy it down:
=SUBSTITUTE(LOWER(LEFT(C2, SEARCH(" ", C2)-1)), "years", "")+SUBSTITUTE(LOWER(RIGHT(C2, LEN(C2)-SEARCH(" ", C2))), "months", "")/100
Note: this assumes all text strings follow the same pattern, where there are no spaces between the number and "years", or the number and "months" (the only space character present is to separate years from months). Also, if the Total Exp is 15 years and zero months, for example, it must read "15years 0months" (if it just says "15years", then the formula will return an error). The same goes for Total Exp of less than a year... it must read "0years 6months". And, of course, 1 year must be "years" (with an "s").
Then, you can use Filters to sort by the converted column:
Custom Text Conversion
Please see the attached workbook, if needed...