Posts Tagged excel functions

Text Split with Excel Formula – Part II

Hi friends,

Here goes the Text Split formula Part II, which will explain how to split First Name, Middle Name and Last Name.

Of course, you can use this many other ways too, so try to understand the logic behind this.

Formulas Used:

Just like previous part, we are also going to use Left, Right & find formulas.

All the three formulas are much simple to use and the real magic is binding them together to get desired results.

LOGIC:

In the first part, we had used find to determine the location of space between two words and then we split it with left & right.

Now in this part we are going to find out further how to find out second space in the given string.

Situation:

If you have a string ‘Firstname Middlename Lastname’, in A3 how you will separate this text with formulas so that you will have firstname, middlename and lastname in separate columns.

Firstname:

Very easy just like what we did in the last part find out the place of separator and use left function.

The formula for the given example is…=LEFT(A3,FIND(” “,A3,1))

Middlename:

This is most interesting part that everybody wants. Here you need to use all the three functions together. First you find out 2nd location of separator and using left formula you will get string ‘firstname middlename’. Then using right formula as in part one you can separate middlename. As this is quiet complicated I will explain this step by step and then together.

Step 1: Find 2nd location of separator formula is … =FIND(” “,A3,FIND(” “,A3,1)+1)

Note: remember to add ‘1′ to last separator location to find out next, otherwise it will keep giving you same results.

Step 2: Find string ‘firstname middlename’ formula is … =LEFT(A3,FIND(” “,A3,FIND(” “,A3,1)+1))

Step 3: Use ‘Right’ function to separate middlename from string in step 2, formula is…=RIGHT(LEFT(A3,FIND(” “,A3,FIND(” “,A3,1)+1)),FIND(” “,A3,1))

Lastname:

Comparatively this is easy, and similar to what we did in last part the only difference is instead of 1st location of separator we are going to use last location of separator.

The formula for the given example is… =RIGHT(A3,LEN(A3)-FIND(” “,A3,FIND(” “,A3,1)+1))

Conclusion:

This way you can split ‘n’ number words with any given separator. Try to find out way to use string functions differently it has enormous power.

Please add your feedback and comments below.

4 comments December 22, 2008

Excel Function – LARGE

This is one of the rarely used functions in excel as many use it’s alternative Max().

Let’s first understand the difference between them so that we will come to know what are the situations where we can use Large instead of Max.

Max function returns the maximum value from the given range, where as Large function 1st sorts the given range internally and returns the i’th from the top.

What i mean is you can use Large function whenever you need to find out 2nd or 3rd largest value from a range or you can even find out sum of top 10 values using this function.

Let’s see the syntax and how to use this function:

Syntax: =Large(Range,i’th Value)

Example: I have a range from A1 to A10 containing some numbers and we need to find out values for following situations:

1. Largest value (even possible with Max function)
=Large(A1:A10,1) or =Max(A1:A10)
2. 2nd Largest Value
=Large(A1:A10,2)
3. 3rd Largest Value
=Large(A1:A10,3)
4. Sum of top 3 Values
=Sum(Large(A1:A10,{1,2,3}))

There are many other ways by which you can use this function in combination with sum and count so try it.

Note: There is also ‘Small‘ function, which works similar to this but exactly apposite way returning you nth smallest value from source array.

I would like if you comment on this article with your valuable suggestions and feedback.

8 comments November 10, 2007


Archives

Recent Comments

rshewade on Text Split with Excel Formula …
Tweety22 on Text Split with Excel Formula …
rotem on Excel Function – LA…
rshewade on Text Split with Excel Formula …
arindam on Text Split with Excel Formula …

Blog Stats

Tags

Advanced Conditional Formatting Excel excel functions Formula Functions help Large MS EXCEL MSEXCEL Named Ranges pivot table PivotTable ranges rare Shortcut Keys Table Formatting text text formula text separate text split tips Top10 tricks Useful Zebra Stripes

Recent Posts

Blogroll