Split contents in a cell with a formula

nagapavan

Board Regular
Joined
Jan 23, 2008
Messages
54
Hi,

I want to split the contents in a cell using a formula. Please help me.

For Example, I have ***PavanKumar*** in A1
I want ***Pavan*** in A1 and ***Kumar*** in B1

Any help would be greatly appreciated.

Thanks in advance
Pavan
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
you can't split the words those, neither have a fixed length nor have a seperater,

if you want to split each word that begins with a upper case letter, try this

Excel Workbook
ABC
1PavanKumarPavanKumar
2SankaraNarayananSankaraNarayanan
Sheet3
#VALUE!
Entered with Ctrl+Shift+Enter


Where 'lnth' is a name defined as

=LEN($A1)
 
Last edited:
Upvote 0
few keystrokes shorter, with an error checking option,
Excel Workbook
ABCD
1PavanKumarPavanKumar
2SankaraNarayananSankaraNarayanan
Sheet3
#VALUE!


where, names defined as

Code:
lngth   =ROW(OFFSET(Sheet3!$A$1,,,LEN(Sheet3!$A1)))
lngth1 =ROW(OFFSET(Sheet3!$A$1,,,LEN(Sheet3!$A1)+1))
 
Upvote 0
Is there a way out if I have a space in between the names for example - Pavan Kumar?

I am looking for a small formula. When I give the function Left or Right, it only gets the data from the cell, but does not cut the data from A1.

Please help me. Thanks

Pavan
 
Upvote 0
if you want to replace the values in column A, try Text to column with space as the delimiter
 
Upvote 0
A1 : PavanKumar

B1 :
{=MID(A1,1,MATCH(2,-1/(EXACT(MID(A1,ROW($1:$20),1),LOWER(MID(A1,ROW($1:$20),1)))=FALSE))-1)}

C1 :
=SUBSTITUTE(A1,B1,"")

Regards
Bosco
 
Upvote 0
Is there a way out if I have a space in between the names for example - Pavan Kumar?

I am looking for a small formula. When I give the function Left or Right, it only gets the data from the cell, but does not cut the data from A1.

Please help me. Thanks

Pavan

A1 : Pavan Kumar

B1, copied to C1 :
=TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",50)),COLUMN(A1)*50-49,50))

Regards
Bosco
 
Upvote 0
Hi Pavan

Another option, for both with or without space, similar to Bosco's

In B1:

=LEFT(A1,MATCH(TRUE,CODE(MID(A1,ROW(INDIRECT("2:"&LEN(A1))),1))<97,0))

This is an array formula, you have to confirm it with CTRL+SHIFT+ENTER.

In C1:

=TRIM(SUBSTITUTE(A1,B1,""))

Ex.:


<table border="1" cellpadding="1" style="background:#FFF; border-collapse:collapse;border-width:2px;border-color:#CCCCCC;font-family:Arial,Arial; font-size:10pt" ><tr><th style="border-width:1px;border-color:#888888;background:#9CF " > </th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >A</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >B</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" >C</th><th style="border-width:1px;border-color:#888888;background:#9CF; text-align:center" width=30 >D</th></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>1</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">PavanKumar</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">Pavan</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">Kumar</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>2</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">Pavan Kumar</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">Pavan</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:left;border-width: 1px;border-color:#888888; ">Kumar</td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td></tr><tr><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;background:#9CF; text-align:center; " ><b>3</b></td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td><td style="border-width:1px;border-color:#000000; padding-left:0.5em; padding-top:0.4em; padding-right:0.5em; padding-bottom:0.25em;text-align:right;border-width: 1px;border-color:#888888; "> </td></tr><tr><td colspan=5 style="background:#9CF; padding-left:1em" > [Book1]Sheet1</td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top