ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Reversing the Word Order within a String
Problem:

Reversing the order of words in each of the two-word strings in column A.

Solution:
Use the RIGHT, LEN, FIND, and LEFT functions as shown in the following formula:
=RIGHT(A2,LEN(A2)-FIND(" ",A2))&" "&LEFT(A2,FIND(" ",A2)-1)


Rate this tip
12 34 5
  RATING: 3.29
  VIEWS: 16433

READER COMMENTS (view all comments)


TIP
JOYDIP DAS wrote on December 31, 1969 19:00 EST
IT WAS A GREAT TIP!
clarification needed
roomi wrote on November 30, 2005 06:32 EST
Hi there,

I saw your tip for "reversing the word order within a string". I am not clear how it works. Can you please give a simple example to demonstrate it working.

Thanks.

My email is :

[email]born2vn2002@yahoo.com[/email]
Reversing the Word Order within a String
Beth Morrison wrote on December 31, 1969 19:00 EST
Very useful -- thanks very much!
clarification needed
born2vn2002 wrote on December 31, 1969 19:00 EST
Hi there,

I saw your tip for "reversing the word order within a string". I am not clear how it works. Can you please give a simple example to demonstrate it working.

Thanks.

michaelas wrote on November 30, 2005 10:41 EST
I could not find an example to compare the formula to.
Clarification:
Bird wrote on November 30, 2005 10:53 EST
Assuming two words are separated by a space in cell A1.

=RIGHT(A1,LEN(A1)-FIND(" ",A1,1))&" "&LEFT(A1,FIND(" ",A1,1)-1)

If two words are separated by a comma then a space, change the ‘-1’ to ‘-2’ before the last right-parameter. The effect is the truncation of both the ‘,’ and the space.
Good One
Siddhanta Goel wrote on December 31, 1969 19:00 EST
Good Tip but please clarify the use of Find function..

siddhanta_goel@yahoo.com
alternate way
AK_Baid wrote on December 31, 1969 19:00 EST
you can also do these by using the following
supposed the word " John is busy" is written in A1
u can reverse the order by the following formula
=mid(A1,6,2)&" "&right(A1,4)&" "&left(A,4) in B1
the answer will by "is busy John"
alternate way
AK_Baid wrote on December 31, 1969 19:00 EST
you can also do these by using the following
supposed the word " John is busy" is written in A1
u can reverse the order by the following formula
=mid(A1,6,2)&" "&right(A1,4)&" "&left(A,4) in B1
the answer will by "is busy John"
I'm stumped
dharlow wrote on January 31, 2006 14:14 EST
I need to reverse the word order of a long list of names of varying lengths. Is this even possible or do I have to type in the formula for each one?
A question
dharlow wrote on December 31, 1969 19:00 EST
I need to find a formula to reverse the word order on a long list of names of all varying lengths. Can I do this or do I have to type in the formula for each one?
reverse the word
ranjeet patil wrote on December 31, 1969 19:00 EST
sir,
i want to reverse the word for example - ranjeet should be teejnar.
Please tell me the formula for this and also can i use it for number of letters.

please me to ranjeethh@surferboard.com.

regards,

ranjeet
Reversing the letters within a string
bosejav wrote on April 26, 2006 11:02 EST
Not possible to reverse the letters in a excel worksheet function (easy in VBA of course) but you can reverse the string and store it in a formula array and then parse the formula array. For example to return the file name for a nested directory structure use the following the worksheet function:

=MID(A7,FIND(CHAR(13), SUBSTITUTE(A7,"",CHAR(13),LEN(A7)-LEN(SUBSTITUTE(A7,"",""))))+1,255)

in cell a7 if you had c:aaabbbbbcdddddfilename the above function would return filename
:)
Reversing the order of words in each of the two-word strings in column A.
jav Bose wrote on December 31, 1969 19:00 EST
Not possible to reverse the order of a string and return to excel as an excel worksheet function (easy in VBA). However, you can return a formula array and then parse the array. For example to return the filename from the path 'c:aaabbbcccdddeeeeeefilename' which is stored in cell A7 do this: =MID(A7,FIND(CHAR(13), SUBSTITUTE(A7,"",CHAR(13),LEN(A7)-LEN(SUBSTITUTE(A7,"",""))))+1,255)



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

Preparing the Marketing Plan (Ama Marketing Toolbox Series New Edition)

The 22 Immutable Laws of Marketing : Exposed and Explained by the World's Two

MP Managerial Accounting w/ Topic Tackler, Net Tutor, & PowerWeb

Microsoft Windows XP Step by Step (With CD-ROM)

The Intelligent Investor: The Classic Bestseller on Value Investing

Business Analysis and Valuation: Using Financial Statements, Text and Cases

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel






Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien