+ Reply to Thread
Results 1 to 16 of 16

Split words in a cell

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    Norway
    MS-Off Ver
    Microsoft 2010
    Posts
    5

    Split words in a cell

    Hi,

    I'm looking for a formula or something to help me to split a certain word in a cell or to return a certain word.

    My example is:
    Sandnesveien 19 M1020
    M1020 Sandnesveien 19


    I need to have the Mxxx in a different cell, which formula can I use to split it? In some cells the Mxxx is before the text and in some it is after.
    Can someone help me?

    Thanks in advance

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Split words in a cell

    This maybe (based solely on your very small sample dataset):

    =MID(A1,SEARCH("M*",A1),5)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Split words in a cell

    you can use Text2Columns then Concatenate() (if neccessary)

  4. #4
    Registered User
    Join Date
    08-14-2017
    Location
    Norway
    MS-Off Ver
    Microsoft 2010
    Posts
    5

    Re: Split words in a cell

    Wow, thanks Ali! It worked perfectly

    Have a lovely day!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Split words in a cell

    Great! Glad to have helped.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Split words in a cell

    If the pattern is ALWAYS M plus 4 digits:

    ="M"&LOOKUP(2,1/(MMULT(0+(ISNUMBER(-MID(" "&A2,ROW(INDIRECT("1:"&LEN(A2)))+{0,1,2,3,4,5},1))+0={0,1,1,1,1,0}),{1;1;1;1;1;1})=6),MID(A2,ROW(INDIRECT("1:"&LEN(A2))),4))

    Ali's will fail if there is an M earlier in the string. Mine will fail if there's another 4 digit number in the string.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Split words in a cell

    Try it with:

    Mandnesveien 19 M1020

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Split words in a cell

    That's why I said this, Glenn:

    ... based solely on your very small sample dataset ...

  9. #9
    Registered User
    Join Date
    08-14-2017
    Location
    Norway
    MS-Off Ver
    Microsoft 2010
    Posts
    5

    Re: Split words in a cell

    My sampleset was a bit to small. I see now that my case have different samples, so Ali's suggestion only worked for the two I have shown.

    What if my sampleset was like this:

    Kanalarmen 08 Bilfinger
    Kanalarmen 10 Simex
    Kanalarmen 12 M1117
    Kanalsletta 02 (Golftower)

    I would only want the formula to return Mxxx or 0.

    Thanks!

    Kind regards
    Thalia

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Split words in a cell

    Try this:

    =IFERROR(MID(A1,SEARCH("M*",A1),5),0)

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Split words in a cell

    See post 6.

  12. #12
    Registered User
    Join Date
    08-14-2017
    Location
    Norway
    MS-Off Ver
    Microsoft 2010
    Posts
    5

    Re: Split words in a cell

    Thanks Glenn and Ali.

    I use Microsoft Excel in Norwegian, and tried your formula Glenn, but it was a bit hard to translate it to norwegian formulas.
    But I'll try again. ;-)

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Split words in a cell

    maybe :
    ="M"&SLÅ.OPP(2;1/(MMULT(0+(ERTALL(-DELTEKST(" "&A2;RAD(INDIREKTE("1:"&LENGDE(A2)))+{0;1;2;3;4;5};1))+0={0;1;1;1;1;0});{1;1;1;1;1;1})=6);DELTEKST(A2;RAD(INDIREKTE("1:"&LENGDE(A2)));4))

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Split words in a cell

    but I think this should be --DELTEKST
    I didn't test formula but double unary changing text number to real number

  15. #15
    Registered User
    Join Date
    08-14-2017
    Location
    Norway
    MS-Off Ver
    Microsoft 2010
    Posts
    5

    Re: Split words in a cell

    Quote Originally Posted by sandy666 View Post
    maybe :
    ="M"&SLÅ.OPP(2;1/(MMULT(0+(ERTALL(-DELTEKST(" "&A2;RAD(INDIREKTE("1:"&LENGDE(A2)))+{0;1;2;3;4;5};1))+0={0;1;1;1;1;0});{1;1;1;1;1;1})=6);DELTEKST(A2;RAD(INDIREKTE("1:"&LENGDE(A2)));4))
    My Norwegian excel will not read {0;1;2;3;4;5} it seems. Any other suggestions here? :-)

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Split words in a cell

    so change ; to ,

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel formula to split words with characters limit per cell
    By montroseite in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2014, 07:22 AM
  2. How to split cell with 3 separate words
    By adamj1910 in forum Excel General
    Replies: 3
    Last Post: 01-17-2013, 10:50 AM
  3. Split String into 4 Parts - Max 30 Characters per Cell and Whole Words
    By keithm_007 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2012, 05:56 AM
  4. [SOLVED] Split a line of words, each word in a separate cell
    By Hitch75 in forum Excel General
    Replies: 13
    Last Post: 08-08-2012, 10:10 PM
  5. split one cell into two with multiple words
    By faze in forum Excel General
    Replies: 12
    Last Post: 12-01-2010, 08:49 AM
  6. Split words with number under one cell
    By Kenji in forum Excel General
    Replies: 5
    Last Post: 04-20-2010, 06:56 AM
  7. How do i split to words(Name) in a cell adding with a dot
    By pradeepdeepu_001 in forum Excel General
    Replies: 4
    Last Post: 02-02-2010, 07:47 AM
  8. How do I split a cell of 2 words into two cells
    By Steven S in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1