Comments on: Excel substring: how to extract text from cell

Although there is no such thing as Substring function in Excel, there exist three Text functions to extract text of a given length from a cell. Additionally, there are FIND and SEARCH functions to get a substring before or after a specific character. Continue reading

Comments page 4. Total comments: 443

  1. Hi All,
    not even sure if this is possible. But i need to return the first 5 digit number from the below alphanumeric text in a cell. the answers should be
    Example 1: 93423
    Example 2: 87952

    Example 1: "**02.06 return updated in SPA** ordered 93423 BR 4PNS PCFC A RK 495L 1X1 x 2 delivered 2 x 4Pns Pl Al 94253 1300353110"
    Example 2: noted with d Short delivered multiple invoices - 2 x BR Vct Br NGB 750 4x3 87952 12 x BR PI N A 5.1% NGB 330ML 4X6IMP 94152

  2. 1. Having input with total four remarks “Received, waived, OTC due, PDD due”
    a. In Column “A" I have number of documents with document description
    b. In Column “B" I have dropdown of Copy or Original
    c. In Column “C" I have Remark of "Received" for Respective document
    d. In Column “E" I have Remark of "Waived" for Respective document
    e. In Column “F" I have Remark of "Short due" for Respective document
    f. In Column “G" I have Remark of " Long due" for Respective document

    2. Outcome required
    a. In Column “A" I required document description either in copy or original having remarks “Received” (1st scenario)
    b. In Column “A" I required document description either in copy or original having remarks “Short due & Long due” (2nd scenario)
    c. In Column “B” I required document nature with outcome of copy or Original as per input data (Required in both scenario)

    Please help here to extract the outcome it will be great help for me thanks in advance

    1. Hi!
      I am not sure I fully understand what you mean. You want to put the result in column A, which already has data. Please provide me with an example of the source data and the expected result.

      1. Point no 1 Narrate about it's source data through subhead which was inputted in sheet no 1

        & point no 2 narrate about required outcome through source data in sheet no 2 therefor I mention column A & B in both Point because these refer two different sheet. I mention the sample data below for sheet 1. please update excel formula which i can use in sheet 2 of same excel.

        DOCUMENT TYPE Received Waived Short due Long due
        sale deed Copy Received
        RD Copy Waived
        Death certificate Copy Waived
        sale deed 2 Copy Received
        ATS Original Short due
        SPA Original Short due
        sale deed Original Long due
        RD Original Long due
        Death certificate Original Long due

        1. Due to some limitation unable to paste excel sheet therefor i mention revised source data for sheet one plz copy & paste the data in excel sheet & share the formula in sheet two
          a. In Column “A" of sheet 1

          DOCUMENT (Heading)
          sale deed
          RD
          Death certificate
          sale deed 2
          ATS
          SPA
          sale deed
          RD
          Death certificate

          b. In Column “B" of sheet 1
          TYPE (Heading)
          Copy
          Copy
          Copy
          Copy
          Original
          Original
          Original
          Original
          Original

          c. In Column “C" of sheet 1
          RECEIVED (Heading)
          Received
          BLANK
          BLANK
          Received
          BLANK
          BLANK
          BLANK
          BLANK
          BLANK

          d. In Column “E" of sheet 1
          WAIVED (Heading)
          BLANK
          Waived
          Waived
          BLANK
          BLANK
          BLANK
          BLANK
          BLANK
          BLANK

          e. In Column “F" of sheet 1
          SHORT DUE (Heading)
          BLANK
          BLANK
          BLANK
          BLANK
          Short due
          Short due
          BLANK
          BLANK
          BLANK

          f. In Column “G" of sheet 1
          LONG DUE (Heading)
          BLANK
          BLANK
          BLANK
          BLANK
          BLANK
          BLANK
          Long due
          Long due
          Long due

          Outcome required in sheet 2

          1. In Column “A" of sheet 2

          a. I required document description either in copy or original having remarks “Received” (1st scenario)
          b. I required document description either in copy or original having remarks “Short due & Long due” (2nd scenario)

          2. In Column “B" of sheet 2

          c. I required document nature with outcome of copy or Original as per input data (Required in both scenario)

  3. hey

    i have a data i need to do the following

    1- i need to select the word ( black )
    2- i need to delet it from the A1 cell
    3- i need to replasce it in cell b1

    ex.

    A1 iphone 6s black
    A2 iphone black 7p
    A3 black flat charger

    what i want to do is

    A1 iphone 6s B1 black
    A2 iphone 7p B2 black
    A3 flat charger B3 Black

    thank you

  4. Excellent content as usual

  5. xboxonefifa14
    3dspokemonmoon
    playstation3ufcundisputed3
    playstation3djhero
    playstation3fifa14
    xbox360pure
    xboxoneforzahorizon2
    playstation2needforspeedunderground
    playstation4yakuza0
    xbox360worms2armageddon
    playstation4soulcaliburvi
    xboxonehitman2

    Hello, I am looking for a way to split the game platforms; (xbox360, xboxone, playstation2, playstation3, 3ds etc) from the game titels; (fifa14, pokemonmoon, djhero etc). Is there a formula I could use ? I tried this formule: =IF(SEARCH("one";A2;2);LEFT(A2;SEARCH("one";A2)+2);1) to split xboxonefifa14 which only worked to split xboxone from the game title, but I couldn't get the game title in a different column. So my question is how I could be able to separate the game titles from different platforms?

      1. Hi,

        Thanks for the reply! The formula worked for the most games and I managed to separate the games from the game platform. However, I do run into trouble with the game platforms; xboxone, xbox360, xboxseriesx, pc and 3ds.

        xboxonefifa14 fifa14onefifa14
        3dspokemonmoon pokemonmoon3pokemonmoon
        playstation3ufcundisputed3 ufcundisputed3
        playstation3djhero djhero
        playstation3fifa14 fifa14
        xbox360pure pure360pure
        xboxoneforzahorizon2 forzahorizon2oneforzahorizon2
        playstation2needforspeedunderground needforspeedunderground
        playstation4yakuza0 yakuza0
        xbox360worms2armageddon worms2armageddon360worms2armageddon
        playstation4soulcaliburvi soulcaliburvi
        xboxonehitman2 hitman2onehitman2
        playstation3nhl13 nhl13
        xboxseriesxassassinscreedvalhalla assassinscreedvalhallaseriesxassassinscreedvalhalla
        pctransistor transistor
        pclifeisstrange2episode3wastelands pclifeisstrange2episode3wastelanlifeisstrange2episode3wastelands

        These are a few games I tried to seperate. Do you have any idea what might cause this problem and why it doesn't replace the game platform with a blank value and copies the game + gameplatform instead?

        The formula I used: =CONCAT(IF(ISNUMBER(SEARCH($H$2:$H$21;A2)); SUBSTITUTE(A2;$H$2:$H$21;"");""))

        Input for H:
        xboxone
        xbox360
        playstation3
        playstation4
        playstation2
        playstationvita
        playstation5
        wii
        switch
        3ds
        psp
        ds
        gameboyadvance
        dreamcast
        xboxseriesx
        xbox
        gamecube
        pc
        wiiu
        stadia

        1. Hi!
          The names of the gaming platforms have partial matches. If you search for xbox360 it will find xbox360 and xbox. Also "ps" can be found in the name of the game.

  6. FI_AC_BONDS
    FI_AC_OBU_LIQ
    FI_AC_SUKUK
    FI_AC_SUK_OBU
    FI_AFS_BONDS
    FI_AFS_OTH_BUS
    FI_AFS_ST
    FI_AFS_SUKUK
    FI_AFS_SUK_OBU
    UNB_FI_AFS_BOND
    UNB_FI_AFS_SUK

    I want to find if AFS or AC word is available on above table and need to get in displace as AFS or AC in another cell.

    1. Hi!
      Based on your description, it is hard to completely understand your task. However, I’ll try to guess and offer you the following formula with SEARCH function:

      =IF(ISNUMBER(SEARCH("AFC",A1)),"AFC",IF(ISNUMBER(SEARCH("AC",A1)),"AC",""))

      If this is not what you wanted, please describe the problem in more detail.

  7. Cell A1 contains Iim Rd, Near Kendriya Vidyalaya, Mubarakpur, Lucknow, Uttar Pradesh 226201

    Cell A2 contains Lucknow

    I need to extract until Lucknow into Cell A3 using a Formula

    Cell A3 FINAL VALUE should be Iim Rd, Near Kendriya Vidyalaya, Mubarakpur ( with or without comma ) is ok

    1. Hi!
      Pay attention to the following paragraph of the article above - How to extract text before a specific character.
      It covers your case completely.

  8. Hello!

    thanks for this very interesting article. Can you help me to solve this problem

    [{ 12, name: Adventure}, { 14, name: Fantasy}, { 28, name: Action}]

    i wana making colum B Adventure; colum C Fantasy and Colum C Action

  9. Rin (Re.1) Advanced Detergent Powder, 10g (Pack of 108) (IA) = 108
    Lays (Rs.10) Potato Chips - Cream & Onion, 30g (Pack of 10) (IA) = 10
    Parachute (Re.1) 100% Pure Coconut Hair Oil, 2.3ml (Pack of 36) (IA) =36
    Too Yumm! (Rs.5) Veggie Stix - Chilli Chatka, 14g (Pack of 12) (IA) =12

    Please help here to extract the number after the word " Pack of"

      1. No sir,

        Its not working ,
        showing blank when i apply this formula.

          1. Hello Sir

            The given formula not working for below cases,

            1.Pampers Baby Dry Pants - M, 2pcs, (Pack of 8)
            2.Colgate (Rs.10) Active Salt Toothpaste, 21g (Pack of 12)

            1. Hi!
              The formula I sent to you was created based on the description you provided in your first request. However, as far as I can see from your second comment, your task is now different from the original one. For this data, another formula is needed.

              =IFERROR(MID(A2, SEARCH("Pack of ", A2) + LEN("Pack of "), SEARCH(")",A2,SEARCH("Pack of ", A2)+1)- SEARCH("Pack of ", A2) - LEN("Pack of ")), "")

              1. Supper Sir,

                Great Thanks.....

  10. I am trying to extract the month from a string like the following
    CF Customer Oct 07
    Ash Customer Sep 07
    Pete Customer Sep 07
    Can you give me a formula?

  11. Hi,
    Can you please suggest in this, will appreciate your help.

    I have some cells like below

    Sushama.K.CTS -> Sushama.K.CTS -> Arbina.B.CTS
    Snehal.C.CTS -> Pooja.G.CTS
    Sonam.C.CTS -> Sonam.C.CTS -> Sonam.C.CTS
    Sonali.S.CTS -> Sonali.S.CTS -> Sonali.S.CTS -> Sonali.S.CTS -> Sonali.S.CTS

    How I can extract the last name from each cells after the ">" symbol.

    Like, my result for above cells should be like

    Arbina.B.CTS
    Pooja.G.CTS
    Sonam.C.CTS
    Sonali.S.CTS

    1. I have tried with this formula,
      =RIGHT(Q3424,LEN(Q3424)-SEARCH(">",Q3424))

      but it's giving me this result

      Sushama.K.CTS -> Arbina.B.CTS
      Pooja.G.CTS
      Sonam.C.CTS -> Sonam.C.CTS
      Sonali.S.CTS -> Sonali.S.CTS -> Sonali.S.CTS -> Sonali.S.CTS

      but I need the last part

      So please suggest.

      1. Hello!
        Replace the last ">" with "#" using the SUBSTITUTE function. Determine the position of this character using the SEARCH function. Starting from this position, extract string from the text using the MID function.

        =MID(SUBSTITUTE(A1,">","#",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))), SEARCH("#",SUBSTITUTE(A1,">","#",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))))+1,50)

        This should solve your task.

  12. Hi, I have a query , it would be great if you could solve this. I have some UPC codes in one cell, i need to copy all the UPC codes into different excel cells.

    077346100626, 011951600003, 781968002106, 692000196342, 885694471981, 715933319937, 199960027704

    I need to copy numbers after every "," sign to different cells.
    Like
    077346100626
    011951600003
    781968002106
    692000196342
    885694471981
    715933319937
    199960027704

    Thanks,

      1. its helpful, but it didn't solve my problem. In the tutorial which you told me, it find the characters in a three word cell, but in my case i have more than 5 or more words separated by ","
        How can i separate them by this formula ?
        in the tutorial it used three functions 1-Left 2-Mid 3-Right
        Is there any thing else i can use to solve this problem ?

  13. Pozdrav !
    Kako izvuci jednu rec iz jedne celije u kojoj ima vise reci ? Evo nekoliko primera celija iz kojih treba izvuci odredjene reci :
    H1 BRENT_OIL at 02:55:02 SuperTrend up -(jedna celija)
    3_Level_ZZ_Semafor_NRP Alert on CrudeOIL, period M15: SELL SIGNAL Level2 -(jedna celija)
    Apollo Scalper CADCHF M15 BUY @0.74719, TP 0.75019, SL 0.74569 -(jedna celija)
    Problemi : Jedna trazena rec ima vise znacenja : (UP,BULISCH,BUY) Drugi primer : (SELL,BEARISH,DOWN).
    Trazena rec nije uvek na istom mestu u celiji. Kako postaviti formulu koja jednostavno pita prvu celiju da li se u njoj pojavila jdna trazena rec : (UP,BULISCH,BUY) ili (SELL,BEARISH,DOWN) Postavio bih formulu za prvo pitanje u recimo D2 a za drugo E2. Ako se bilo koja rec od trazenih pojavi moze se napisati u istoj celiji gde je postavljena formula ili nekoj drugoj svejedno... Tako bih sa te dve kolone pratio signale koji se pojavljuju u prvoj koloni ? Svasta sam probao pa sam se zamrsio izgleda jednostavno ali je zapetljano...Primeri koje sam koristio pa mi nije bas sve uspelo :
    =IF(SEARCH("UP",D2),G10,H10) =IF(ISNUMBER(SEARCH("UP",D2)),G10,H10)
    =IF(SUMPRODUCT(-ISNUMBER(SEARCH("UP",D2:D2))),"0","UP") =TRIM(MID(D2,SEARCH("UP",D2)+10,LEN(D2)))
    =IF(ISNUMBER(SEARCH("supertrend",D2)),G2,"")&IF(ISNUMBER(SEARCH("apollo scalper",D2)),G3,"")
    Itd... Hvala
    Goran

    Hello!
    How to extract one word from one cell that contains several words? Here are some examples of cells from which certain words are extracted:
    H1 BRENT_OIL at 02:55:02 SuperTrend up - (single cell)
    3_Level_ZZ_Semaphore_NRP CrudeOIL warning, period M15: SALES SIGNAL Level 2 - (single cell)
    Apollo Scalper CADCHF M15 BUY @ 0,74719, TP 0,75019, SL 0,74569 - (single cell)
    Problems: One search word has several meanings: (UP, BULISCH, BUY) Another example: (SELL, BEAR, DOWN).
    The search word is not always in the same place in the cell. How to set up a formula that simply asks the first cell if one of the search words appeared in it: (UP, BULISCH, BUY) or (SELL, BETTER, DOWN) I would set the formula for the first question in say D2 and for the second E2. If any of the words of the requested occurrence can be entered in the same cell where the formula is located or someone else doesn't care ... So, I would follow the signals that appear in the first column from those two columns? I tried everything, so I was confused, it looks simple, but it's complicated ... Examples I used, so I didn't succeed:
    = IF (SEARCH ("UP", D2), G10, H10) = IF (NUMBER (SEARCH ("UP", D2)), G10, H10)
    = IF (SUMPRODUCT (-UM (SEARCH ("UP", D2: D2))), "0", "UP") = TRIM (CENTER (D2, SEARCH ("UP", D2)) + 10, LEN D2)))
    = IF (ISBROJ (SEARCH ("supertrend", D2)), G2, "") & IF (ISBROJ (SEARCH ("apollo scalper", D2)), G3, "")
    Etc ... Thanks
    Goran

    1. Hello!
      If I understand the problem correctly, you can use the SEARCH function to search for the desired word. With nested IF functions, you can check two conditions.
      Please try the formula below:

      =IF(SUM(--ISNUMBER(SEARCH({"UP","BULISCH","BUY"},A2))) > 0,$D$2, IF(SUM(--ISNUMBER(SEARCH({"SELL","BEARISH","DOWN"},A2))) > 0,$E$2,""))

      I hope it’ll be helpful. If something is still unclear, please feel free to ask.

      1. Pozdrav !
        OK Pomaze Thanks
        Goran

  14. Super helpful. Thanks

  15. Hello Alexander,

    I hope you can help me, I have a list of transactions in column J and a list of text in a separate tab in the same workbook. I want to write a formula to find this text in the separate tab and extract this from the transactions (Column J) and the result should be in Column N.

    For Example:

    Column J

    "Int Debit Order To Settlement
    "Cashsend Digital SettlementCard No.
    Digital Tran Fees Settlement *
    Bal Brought Forward
    Monthly Acc Fee Headoffice *
    Transaction Charge Headoffice *
    "Int Debit Order To Settlement"
    "Acb Debit:External Settlement 19.75 "
    "Digital Transf Cr Settlement"
    "Atm Withdrawal 31.50 TCard No. "
    "Pos Purchase Settlement 4.35 TCard No. (Effective 16/05/2022)"
    "Notific Fee Sms Notifyme 1.20 T2 Sms Notifications"
    PY 4654654654Transfer

    Separate Tab List in Column Q:

    Notific Fee Sms
    Bal Brought Forward
    Pos Purchase
    Acb Debit:External
    Transaction Charge
    Monthly Acc Fee
    Cashsend Digital
    PY 4654654654
    Int Debit Order To
    Digital Tran Fees
    Atm Withdrawal

    In Column N:

    I need the formula to search from the list (Separate Tab) and extract the text from the transactions in Column J.

    If you could assist me with this formula please.

  16. Hi

    Please resolve my below problem:

    I Have data in cells as below:

    A1= 1B90
    A2= 1B113
    A3= 3DE- 61
    A4= 1E-105

    And I want as below:

    B1= B
    B2= B
    B3= DE
    B4= E

  17. Hi

    I need to extract whatever string is between the 3rd and 4th undercover of the texts below:

    asd_KSA_Consideration_LocalFootball_Beverages_Core 18-34_Trueview_Youtube_CLE_February2022_1546960|1862997

    Here the answer should be "LocalFootball"

    asd_KSA_Awareness_LocalFootball_Beverages_Core 18-34_Bumper Ads_Youtube_CLE_February2022_1546960|1440241

    Here the answer should be "LocalFootball"

    asd_KSA_Awareness_LaunchKSA_Beverages_CoreAudience_Bumper Ads_Youtube_CLE_BLS_March2022_1918871|1311320

    Here the answer should be "LaunchKSA"

    asd_KSA_Consideration_LaunchKSA_Beverages_InMarket_Discovery Ads_Youtube_CLE_BLS_February2022_1918871|1740112

    Here the answer should be "LaunchKSA"

    asd_KSA_Awareness_LaunchKSA_Beverages_CoreAudience_Video_DV360_PGD_Adintop_February2022_1918871|1014779

    Here the answer should be "LaunchKSA"

    asd_KSA_Conversion_LaunchKSA_Beverages_CoreAudience_Video_DV360_PGD_DMS_February2022_1918871|1883124

    Here the answer should be "LaunchKSA"

    asd_KSA_Consideration_LaunchKSA_Beverages_CoreAudience_Trueview_Youtube_CLE_BLS_February2022_1918871|1362081

    Here the answer should be "LaunchKSA"

    asd_KSA_Conversion_Launch_Beverages_CoreAudience_Video_DV360_PGD_Vidmatic_March2022

    Here the answer should be "Launch"

    asd_KSA_Conversion_Launch_Beverages_CoreAudience_Video_DV360_PGD_Vidmatic_March2022_Cancelled

    Here the answer should be "Launch"

    asd_JOR_Consideration_Max_Beverages_Core 18-35_Trueview_Youtube_CLE_March2022_OD22|3228

    Here the answer should be "Max"

    asd_JOR_Awareness_Max_Beverages_Core 18-35_Bumper Ads_Youtube_CLE_March2022_OD22|3228

    Here the answer should be "Max"

    asd_KSA_Awareness_CFBQ1_Beverages_CoreAudience_Video_DV360_PGD_MMP_February2022_1963621|1373446

    Here the answer should be "CFBQ1"

    asd_KSA_Awareness_CFBQ1_Beverages_CoreAudience_Video_DV360_PGD_DMS_February2022_1963621|1564216

    Here the answer should be "CFBQ1"

    asd_KSA_Consideration_CFBQ1_Beverages_CoreAudience_Trueview_Youtube_CLE_BLS_February2022_1963621|1508651

    Here the answer should be "CFBQ1"

  18. Hello,

    I have the following statement where I'm trying to pull the numerical value's off the far right side (a: 157.00; b: -0.23; c: 9.00). I have tried the example up the top for RIGHT function but it jut pulls everything excluding the month (Feb). If I drop the LEN function and just use SEARCH it pulls only four characters from the right (a:7.00; b:0.23; c: 9.00).

    Feb 07 Mudgee Vet Surg Mudgee Au 034254325786123489 157.00
    Feb 06 Temple & Webster St Peters Au 25643965992308034556 -0.23
    Feb 05 The Brumby Nepalese R Nadal Au 75123502038260262235719 9.00

    Thank you for your help in advance.

    Cheers,
    Rowie

  19. Dear Sir,
    I have texts in a large xls in the pattern of
    APLHA|Alphanum1|alpha num2|alpha num3 - the length of each alphanum is not fixed. Text has spaces too.

    I need to get all the text upto the last | delimiter - i.e. - "APLHA|Alphanum1|alpha num2"

    Could not make any of the above work. Please assist.

    1. Hello!
      Use the SUBSTITUTE function to replace the last delimiter with another character. Calculate the position of this character using the SEARCH function. Get the required number of characters using the LEFT function.

      =LEFT(A1,SEARCH("#",SUBSTITUTE(A1,"|","#", LEN(A1)-LEN(SUBSTITUTE(A1,"|",""))))-1)

      I hope my advice will help you solve your task.

  20. Primary Street Stored in A1
    560, 95, Kanpur Road, Krishna Nagar Village, Krishna Nagar, Alambagh, Lucknow, Uttar Pradesh 226023

    Primary City Lucknow Stored in A2

    a3 should retun text to left of Lucknow ( a2 )

    ie., 560, 95, Kanpur Road, Krishna Nagar Village, Krishna Nagar, Alambagh,

    Thanks in advance

      1. Thanks Brother, it helped

  21. I need to find the string before "-DT" or "-LT" from following

    QDY3-DT-HC00121
    ZYN-LT-000013
    CN-URB-LT-00036A23
    WILT-DT-LPD001

    so the results would looks as follows

    QDY3
    ZYN
    CN-URB
    WILT

    1. Hi!
      Pay attention to the following paragraph of the article above: How to extract text before a specific character.
      It covers your case completely.

      =LEFT(A2, IF(ISNUMBER(SEARCH("-DT",A2)-1),SEARCH("-DT",A2)-1,SEARCH("-LT",A2)-1))

      To use two search conditions, use a nested IF function.

      1. Thanks for the response, it works perfectly. also I referred the above mentioned paragraph but still couldn't understand logic being used in this formula :( . would you be able to explain your formula. also if I want to add one more string "-SRV", what would be the new formula. hope that would help me to understand the logic

        1. Hi!
          To search for multiple variants of a specific character, you can use the formula

          =CONCAT(IFERROR(LEFT(A2,SEARCH({"-SRV","-DT","-LT"},A2)-1),""))

          The IFERROR function will replace failed search errors with empty strings. The CONCAT function converts an array of search results into a single text string.

  22. Hello
    if i cells with:
    111222
    11222
    1222

    and i want extract "1" from them like this:
    111
    11
    1

    how i can do it?

    1. Hello!
      Use substring functions to extract text from cell:

      =LEFT(A1,SEARCH(2,A1)-1)

      Hope this is what you need.

  23. Hi can you kindly help me, i have a situation where in a cell there is a few items that i need to separate out into different columns

    "Item 1. D/W RSC (CTN 35)
    Material Code: -
    Quantity: 1,000 piece
    Account Name (GL): OPS PACKING MATERIALS (4340000)
    BusA/CC: AM71/AM2D
    Mandatory to Quote: Yes

    Item 2. D/W CTN (CTN 90)
    Material Code: -
    Quantity: 1,000 piece
    Account Name (GL): OPS PACKING MATERIALS (4340000)
    BusA/CC: AM71/AM2D
    Mandatory to Quote: Yes

    Item 3. D/W CTN (CTN 98)
    Material Code: -
    Quantity: 2,000 piece
    Account Name (GL): OPS PACKING MATERIALS (4340000)
    BusA/CC: AM71/AM2D
    Mandatory to Quote: Yes

    Item 4. D/W RSC (CTN 56)
    Material Code: -
    Quantity: 1,000 piece
    Account Name (GL): OPS PACKING MATERIALS (4340000)
    BusA/CC: AM71/AM2D
    Mandatory to Quote: Yes

    Item 5. S/W RSC (CTN 28)
    Material Code: -
    Quantity: 1,000 piece
    Account Name (GL): OPS PACKING MATERIALS (4340000)
    BusA/CC: AM71/AM2D
    Mandatory to Quote: Yes

    ( This is all in 1 cell)
    How do I separate them
    I'm in desperate need, please help me, thank you

    1. Hello!
      If you want to split text into cells by line break, you can use the Excel tool - Text to columns. Use the key combination CTRL+J to specify line feed as "other" character.
      You can also use the Split Text tool. It provides many options to split text into cells. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.

      1. is there any formulas that i can use?

  24. Hello!

    we have columns of data in each - mention below.
    Please help us to segregate M followed by 8 digits in a separate cell.
    -------------------------------------------------------------
    "3 laptops

    Po# m17121848 item # 9999207718877
    Po# m18147289 item # 9999207707199
    Po# m34283154 item # 9999207718875"
    -------------------------------------------------------------
    "p.o m31153508
    item number 9999207495586"
    -------------------------------------------------------------
    "p.o. m355515737
    item number 9999207564615"
    -------------------------------------------------------------
    "p.o m31153508
    item number 9999207495586"
    ------------------------------------------------------------
    "p.o m31153508
    item number 9999207495586"
    -------------------------------------------------------------

      1. Thanks for the response. The above formula is working for Single M in single cell but we have more of multiple M************** in single excel cell. can you please us to provide mulitple M formula.

          1. we want to extract multiple occurrence of M with 8 digits only in single cell data. for example

            we have data in a single cell of below

            Po# m17121848 item # 9999207718877
            m18147289 item # 9999207707199
            Pom34283154 item # 9999207718875"

            we want to get in a cell like below:
            M17121848
            M18147289
            M34283154

            Thanks for your help.

          2. i want to get M followed by 8 digit. i have multiple occurrence Mxxxxxxx in a single cell data. on this formula (=MID(A2,SEARCH("m",A2),9)) work for single occurrence of M followed by 8 digits please help me to get all other occurrence of M.

        1. For example:

          Below data available in single excel cell.

          Po# m17121848 item # 9999207718877
          m18147289 item # 9999207707199
          Pom34283154 item # 9999207718875"

  25. Hi,

    I have this data and I need to extract only the characters under the format M9xxxxxxxxxx.

    M90000000001; 1062172; 4503260578
    M90000000002; L20000000001; M90000000005
    M90000000003

    I am using the formula: =MID(A2,FIND("M9",A2,1),12) but this does not bring all the data, in case I have 2 values in a single cell M9xxxxxxxxxx (i.e. line 2).

    Is there a way to extract both?

    Thank you!

      1. Thank you for the suggestion!

  26. Hello!
    I have data in this format under excel sheet.
    I only want to extract characters from the below column, how do I leave/remove special characters (unwanted symbols) and only extract characters which are present in each row.
    Please help me..

    location

    Yakima, WA
    Distrito Federal, México
    Prison
    ?
    laugh of january
    Karachi, Pakistan
    kiwook. ♡
    grace, she/her, 24
    QATAR
    eve ♡ [swe/eng/한]
    Bengaluru, India
    Saudi Arabia .Taif
    kiwook. ♡
    Lab of Womb
    Nederland
    Calabria, Italia
    Iraq
    Alexandria/Tanta
    #everywhere
    Ruwa Zimbabwe
    Reality
    Ayodhya
    Maldives
    ??
    Szczecin, Polska
    Hargeisa, Somaliland
    Prosthodontics Section, CoD
    Davao City, Davao Region
    under these bitches’ skin
    Islamabad, Pakistan
    ??
    khandwa mp
    New York, NY ✈️ Houston, TX
    United Arab Emirates

    Atlantis
    Lampung, Indonesia

    08/30/17

    Jakarta Pusat, DKI Jakarta

    losers club
    tyler williams inc
    Kharkhoda, India

    Iraq

    Tweets are my own and not representative of my employer

    Philippines

    Jeddah - khartoum
    Madinah

    1. Hello!
      To remove special characters from text, you can use regular expressions. You can find the examples and detailed instructions here: Excel Regex to remove certain characters or text from strings.
      You can use this formula:

      =TRIM(RegExpReplace(A5, "[^0-9a-zA-Z\.,/ ]+", ""))

      You can also use Regex Tools for Excel. With Regex Tools, which are part of Ultimate Suite for Excel, you can find, extract, remove, or replace strings that match a pattern.

  27. Hello, I have a task to extract a specific location code from a string. Examples from the text I am using are as follows:
    AUS177-4M
    Canada551-3W
    MEX316-3W
    US160-3Mo
    ARG265-2W
    MEX363-5Mo
    US351-4W
    GER195-6Mo
    GER529-2Mo
    AUS301-7Mo
    GER60-3W
    ENG102-8Mo
    AUS219-9W
    ENG342-10Mo
    US476-11M
    GER93-6W
    GER442-10M
    Japan17-8W
    Canada559-11Mo
    ARG389-11Mo
    Canada121-12M

    As you can see the data aren't neatly arranged, nor are they all a set amount of characters long. I need to be able to extract the location text (Canada, GER, US, Japan) exactly as it appears in the text string and display it in another column. Is there any way you could assist me in this?

    1. Hello!
      To extract all characters up to the first digit in the text, try using the formula

      =LEFT(A2,MIN(IF(ISERROR(FIND({1;2;3;4;5;6;7;8;9;0},A2)), "",FIND({1;2;3;4;5;6;7;8;9;0},A2)))-1)

      Hope this is what you need.

      1. If I just wanted to display the number or letter(s) at the end of a string, would this approach work also? For example, If I had HSM-11Mo, and I wanted to display just the 11 or the Mo inside of a column by itself, would I be able to with this type of formula? I am not an excel expert by any means so I apologize for any confusion in my statement.

        1. Hello!
          If you want to show all characters after the last digit, then try this formula:

          =MID(A2,LOOKUP(,-MID(A2,ROW($1:$99),1),ROW($1:$99))+1,50)

          1. This formula works on most of the cells in my data set but a few of them still include the dash and number. For example, the data
            NGE270-18M
            SUA110-5M
            EXM390-18Mo
            NGE430-17W

            would all return a -18M or -18Mo or -17W depending on the cell. Is there anyway I can fix this?

  28. I have data in this format under excel sheet.

    S02E01.the.Wild.Goose.Chase
    S02E02.Needle.in.a.Haystack
    S02E03.Might.of.the.Atwal.Empire
    S02E04.True.Lies
    S02E05.Wedding.Bells.Make.a.Loud.Sound
    S02E06.Revenge.Is.Best.Served.Cold
    S02E07.the.Girl.and.the.Cop
    S02E08.Goons.Guns.and.Bombs
    S02E09.the.Hunter.Is.Now.the.Hunted
    S02E10.Thats.the.Way.the.Cookie.Crumbles

    I want result as any data excluding starting 7 characters.

    Thanks

  29. Hello

    I would appreciate any help. I have a high volume of the below data (located in one cell);

    "Winning Combination: 2/1/1/1/1/2/1/1/3/1
    Status: Official
    Results: (9/10)
    Winners: 2015.43
    Dividend: R42.60
    Results: (10/10)
    Winners: 141.00
    Dividend: R2,439.80"

    I need to extract;

    2015.43
    42.60
    141
    2439.80

    Any advice?

    Thanks

  30. Hi there. I have a column with notes where I want to extract the 15 digits that appear after IRCT (or irct), including the IRCT into an adjacent (blank) column. The IRCT number can appear anywhere in the cell.
    E.g. (2022-02-09 16:24:37)(Select): irct2012042495523N1;
    or IRCT2017011520145N4; (2021-09-01 15:31:36)(Screen): #66 Abdollahi 2019 might be linked & has abstract

    Are you able to help? I can only find instructions for extracting a) after a single character (not a string) and no instructions for specifying the length of the string to be extracted.
    Thank you!!

    1. Hello!
      Please use the following formula -

      =MID(A1,SEARCH("irct",A1),19)

      The article above has all the information you need. I hope it’ll be helpful.

      1. Brilliant! Thank you so much for the quick response - much appreciated :-). One final question, if the cell doesn't contain "irct", what is the argument for returning a 0, rather than #VALUE!)

      2. Thank you for this!! I was looking for something similar.

  31. How Can I select sugar and flax from this formula

    "Milk, sugar, Vegetable shortening, canola oil, milk powder, cardamom essence, whole wheat flour, flax seed, raisin, sugar, almond, cashew"

  32. what formular can i use to extract only characters in a cell without the LAST 4 DIGITS
    e.g "Vitamin A supplementation 6-11 months 2019" results should be "Vitamin A supplementation 6-11 months"
    and
    "LLIN given to pregnant women 2021" results should be "LLIN given to pregnant women"

    1. Hello!
      Extract all characters from the text, except the last four. Use the LEFT and LEN functions.

      =LEFT(A1,LEN(A1)-4)

      I hope I answered your question.

      1. it worked!!, thanks

  33. Hi,

    I have cells containing this pattern:
    A.BBBBB
    A.B.CCCCCCC
    A.B.C.DD

    How do I get the substring to the right of the utmost right period, e.g. BBBBB, CCCCCCC, DD?

    TIA!

      1. Thanks Alexander, this helps a lot, though not completely, since some of the strings look like A.B.C.DD-EEE and it's DD-EEE that I'd like to extract.

          1. You're super. Thanks a lot!

  34. Hey, How can I extract from cell containing 4c,5c,9e,10z,12c the words containing c like, the extraction of above should look like- 4c,5c,12

      1. Thanks, But is there anyway of implementing this into Google Sheets?

        1. Hello Siddhant,

          RegExpExtract doesn't work in Google Sheets but you can try this formula instead:
          =ArrayFormula(TEXTJOIN(",",TRUE,IFNA(REGEXEXTRACT(SPLIT(A1,","),"\d+c"))))

  35. Olá,

    Eu gostaria de extrair para outra coluna o 3880-109 Ovar do seguinte texto; Zona Industrial de Ovar, Loja n.º L 00.013, Av. Dom Manuel I, 3880-109 Ovar.

    Como faço isso?

    Obrigado

    1. Hello!
      I believe the following formula will help you solve your task:

      =MID(A1,SEARCH("#", SUBSTITUTE(A1,",","#",LEN(A1)- LEN(SUBSTITUTE(A1,",",""))))+2,50)

      1. Obrigado Alexander Trifuntov pela pronta ajuda, infelizmente meu excel é de 2007 em português e a fórmula dá erro.

          1. continua a dar erro na fórmula

            1. Hi!
              Perhaps you do not use a comma, but a semicolon as a separator in the formula. It depends on the regional settings of your Windows.

  36. Hello!

    I'd like to extract a string of text that occurs between the first "_" and the 5th "_" from the right (after "ztt_" and before "_dev_rev_vX_icr_tt", where X is a changing version number)

    For example -
    Cell: ztt_tool_vacuum01_dev_rev_v3_icr_tt
    Extract: tool_vacuum01

    Another example -
    Cell: ztt_first_mom_hair01_col01_dev_rev_v9_icr_tt
    Extract: first_mom_hair01_col01

    Another example -
    Cell: ztt_mop_def01_col01_dev_rev_v4_icr_tt
    Extract: mop_def01_col01

    Could you help? Thank you :)

    1. Hello!
      Please check the formula below, it should work for you:

      =MID(A1,SEARCH("_",A1,1)+1,SEARCH("_dev_rev",A1,1)-SEARCH("_",A1,1)-1)

      Hope this is what you need.

      1. This worked wonders! Thank you kindly :)

  37. HI,
    Thanks a lot for your attention and reply,
    If you suggest different formulas for different patterns.
    I will be very thankful to you.

  38. Hi,
    Very nice article.
    I want to get the result following text string:-
    P08LREMTNM172// 10.139.131.69-LTS-MTN-MSAG25CANALBANK2-A-M result is canal bank
    P08LREFZDM090//Neshaman Park Awan Market Ferozpur Road 10.139.97.146 result is neshaman park
    P08LREGBGM101//C-51 Hafeez center Gulberg 10.139.82.198 result is hafeez center
    P08LREARDM064//10.139.130.166-LTS-ARD-C15BTYPEFLAT-A-M result is c15bty
    P08LREMTNM065//10.139.131.14-LTS-MTN-065HanjarwalChowk-A-M result is Hanjarwalchowk
    P08LREGNRM025//10.139.114.30-LTS-GRI-C2160feetRoad-A-M result is c2160feetroad
    P08LREGNRM018//10.139.114.130-LTS-GRI-C19JaffriaColony-A-M result isc19jaffriacolony

    P08LREMALM054//10.139.64.86-LT-LHR-MSAG14sunderIndustrialstateMAL-Z-M result issunderindustrial estate
    P08LREASLM050//MSAG-1 Central Park FZRD 10.139.47.110 result is central park
    P08LREFZDM024//10.139.115.14-LTS-FZR-C25niaziachkFZR-A-M result isniaziachk
    P08LREFZRM085//MSAG-51 -Qanchi Main Bazar near Batul Islam Madrassa- FZR 10.139.97.126 result is Qainchi main bazar
    P08LREJTNM020//C-29 Near Bank Lalazar Colony Phase-II (Riawind Road) Lahore -10.139.78.134
    P08LREGNRM017//10.139.114.98-LTS-GRI-B4ChubarjiparkGRI-A-M
    P08LREMRDM008//C-35 Near Ilyas Autos Saidpur Multan Road -10.139.77.158

    and so on
    I will be very appreciate your great help..
    Thanks,

    1. Hi!
      To write a formula to extract a string from text, your data must have a common pattern and be consistent. I don't see it here.

  39. superb explanation !...

    enjoyed throughout reading & understanding this article . maintain this easiness in every complex things. specially with illustration out of the box

  40. Thanks really it

    helpful for me

    keep going guys
    it
    use a smart functions
    thanks

  41. Hello!
    I want to extract the date from this text message:
    Overdue for unfinished orders as of: 16-11-2019

  42. Hi,

    I want to extract the just the website address and not the rest of the links. Can you help me with the formula?

  43. Hello,

    Are you able to extract the last bit for me, i.e. '1453510'

    /CODE/ZZ/PARIS-LONDON/89853323/1453510

    Many Thanks,

    1. =RIGHT($B2,LEN($B2)-SEARCH("/",$B2,LEN($B2)-8))

  44. Hi,

    If I want to extract just the name, what formula to use?

    Farms Limited #33-1A

    thanks,

    1. Hi!
      Try the following formula:

      =LEFT(A1,SEARCH("#",A1)-1)

      You didn't explain, but I'm guessing the name will be retrieved.

  45. Hello Ablebits Team,
    I have some data that I need to extract but can't seem to find the answer above, this is one of the cells that I need to extract a Product ID from (all cells will have varying numbers of characters) -

    "adult=No,age_group=Adult,c2c_barcode=4062451243197,c2c_colour_swatch=16402,c2c_excerpt=The classic design of the Puma Road Map Golf Polo Shirt is simple enough to pair up with any golf trousers or shorts yet stylish enough to get you through your round with confidence. ,c2c_features=
    dryCELL moisture-wicking technology
    UPF 40 UV protection
    Stretch fabric
    Puma branding
    80% Polyester / 15% Cotton / 5% Elastane
    ,c2c_mpn=595788-06,c2c_noaddtocart=0,c2c_rrp=40.00,call_for_price=No,color=Ibiza Blue/Dark Denim (PU595788-06),cross_over_id=PU59578817,default_price_of_set=0.000000,description_below_images=0,ping_popup=No,pl_size_chart=Puma Men's Clothing,price_per_unit=0,product_tag=Sale,size=S,size_system=UK,size_type=Regular"

    Basically, all of the cells will include the cross_over_id= but what I need to extract is the actual cross_over_ID - in this instance it is PU59578817, is there a formula for this, please?

    1. Hello!
      The formula below will do the trick for you:

      =MID(A1,SEARCH("cross_over_id=",A1)+14, SEARCH(",",A1,SEARCH("cross_over_id=",A1)+14) - (SEARCH("cross_over_id=",A1)+14))

      1. Alexander, you are an absolute legend! Thank you.

  46. I have a string

    Maintenance Charlie 1,2590 @ 2,000 service period 4/1/2021 to 3/31/2022

    I would like to extract from date in one column and end date in another column, help me how can I do that

  47. Hello,

    I have a document coding which will be in the same format which has 3 Hyphen and 2 space and 1 dot (occasionally)

    Eg for max lenght of textstring is: AAA-(BBB)-C99-DD 5555.001 (XX-YY)
    Eg for min lenght of textstring is: AAA-(BB)-C8-DD 5555 (XX)

    I need to print each section in the coding to a different cell. For example;

    A1: AAA
    A2: (BBB)
    A3: C99
    A4: DD
    A5: 5555
    A6: 001
    A7: (XX-YY)

    I couldn't sort it out the formula for "DD" section after last hyphen and before space and the remaining text. Thanks in advance.

    1. Hello!
      Your string is too long to be split using a formula. It also has no common pattern. Do I recommend using the Split Text tool, as described in this guide. Separate by "-" first, then by other separators. Use the Transpose tool to write the result to a column.
      You can try them in trial mode.

  48. column of data with either numbers of varying length or numbers of varying length followed by a letter. I need to split this column into 2 columns. If the cell is a number then the 1st column should simply return the number and the 2nd column will remain empty. But if the cell contains any text the 1st column will return the numbers from the cell and the second column will return any letters. Thanks so much for any help.

    For instance

    Col A Col B Col C
    671 671
    894256 894256
    89G 89 G
    9451w 9451 w
    4589 4589
    12tw 12 tw

    1. Hello!
      Use the formula from the article — How to get number from any position in a string.
      To extract all letters except numbers from a cell, use the formula:

      =SUBSTITUTE((CONCAT(IF(NOT(ISNUMBER(--MID(A3,ROW(INDIRECT("1:"&LEN(A3))),1))),MID(A3,ROW(INDIRECT("1:"&LEN(A3))),1),"")))," ","")

      I hope my advice will help you solve your task.

  49. 1-356039-1-1-11771232_82253500
    Hello,

    I am trying to extract the cell right of 1-356039-1-1-, but I can't seem to get it work.

    Any tips?

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =MID(A1,LEN("1-356039-1-1-")+1,50)

  50. Hi ,

    When I generate a report daily one coloum consist of delimited text where I need to search some keyword like (count :1) I need to get the assigned value of count .. can some one help please

      1. Hi ,
        A sample sentence has been provided below , content will be be different need to get the value of count

        Eg :
        This has been updated count :02 , please check

        Excpeted output :02

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)