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 3. Total comments: 443

  1. I am trying to extract parts of a date in a cell to format it differently on a different sheet.

    Starting with a cell containing "2023-03-11T14:07:58", "I need to reformat this as 2023-03-11 14:07:58 UTC"

    Can I do this by combining some of the functions on this page? Or is there another way?

  2. I want to extract the flat and Tower in this example is denoted by TL which comes right after the cheques from the left. Is there anyways to get it right?

    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007747~902620102 CHQ. NO:007747 23062026972504242645 - AE0190095
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007746~902620102 CHQ. NO:007746 23062026972504242643 - AE0189708
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007724~902620102 CHQ. NO:007724 23062026972504242638 - AE0189619
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007723~902620102 CHQ. NO:007723 23062026972504242626 - AE0189194
    CLEARING CHEQUESF1203 TL19 DEFAULT - CHQ. NO: 000131~302620177 23062026023062001250 - AE0173816
    CLEARING CHEQUESF408 TL7 DEFAULT - CHQ. NO: 000097~102620128 23062026023062001249 - AE0173462
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007722~902620102 CHQ. NO:007722 23062026972504242630 - AE0141381
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007720~902620102 CHQ. NO:007720 23062026972504242633 - AE0141371
    CLEARING CHEQUESIN-HOUSE CHEQUE TRANSFER CHQ. NO: 007726~902620102 CHQ. NO:007726 23062026972504242605 - AE0141335
    OUTWARD CLEARINGF603 TL5 DEFAULT - ~2549518001 CHQ. NO: 000017~804020101 23061026023061001594 - AE0060948
    CLEARING CHEQUEINWARD CLEARING CHQ. NO: 007717~902620102 CHQ. NO:007717 23061100000012570428 - AE0012593

  3. I have a list of TEXT, over 90,000 lines . I copied from a webpage, approx 25,000 names and added it to my list. Now when I sort the list alphabetically, it does not work properly. For example the following is an extract
    ABLAZING GRACE
    ABLE BEAUTY
    ABLE HIT
    ABLE IVY
    ABLE LASS
    ABLE LOTTY
    ABLE MAGPIE
    ABLE MILLIE
    ABLE QUEST
    ABLE RAMON
    ABLE SABLE
    ABLE TO RUN
    ABLE VIVA
    ABLE BONNIE
    ABLE CUSTOMER
    ABLE FAME
    ABLE LANE
    ABLEBE

    You will see that ABLE BONNIE, ABLE CUSTOMER, ABLE FAME and ABLE LANE are not in the correct order. These are what I added from a webpage. Interestingly, if I retype the name and resort my list, the retyped value is sorted correctly.

    I cannot possibly spend the hours to retype all these names - does anyone have a solution - I have tried everything I know ! Thank you

  4. Hi,

    I am trying to extract the Last Name - "Twain" from this data:

    Shania Twain\ShanTw00

    Is there an easy way to do this with a formula?

    1. Hi!
      Please read the above article carefully. Try to use information in this article: How to extract text before a specific character and How to extract text after character.

      =RIGHT(LEFT(A2, SEARCH("\",A2)-1), LEN(LEFT(A2, SEARCH("\",A2)-1))-SEARCH(" ", LEFT(A2, SEARCH("\",A2)-1)))

  5. Hi! I have the following data set and I need to extract weather the model is "RHS" or "LHS" using only =SEARCH

    RHS FRONT SEAT ASY 2WAY COMP
    FRONT SEAT ASY COMP RHS 2WAY
    FRONT SEAT ASY COMP LHS 4WAY
    RHS FRONT SEAT ASY COMP 6WAY

    Many thanks!

    1. Hi!
      I don't quite understand what you want to extract. Give me an example of the result you want to get. But in any case, you need to use other Excel functions besides the SEARCH function. Please read the above article carefully.

  6. 23.13 1/17/2023 P64634 01 DOE, JOHN
    123.14 1/27/2023 6463401 DOE, JASON ALLEN
    3.14- 12/15/2023 F 6463401 DOE, JASON ALLEN

    Could use some help if anyone can. Needing a macro or formula that will put this one cell of data usually in Column A into five different columns. Each line of data is a dollar (sometimes a negative after the value), date, account number (sometimes the is a letter that is separated in front or there is a digit or two separated at the end), and then a name. Always Last, First (sometimes the middle name or initial is there). Text to column won't work since there are not always the same width in between the different data types and sometimes the account number has the space in the beginning and/or the end. Any help would be appreciated. Thanks! :)

    1. Hi!
      Your text strings do not have a single pattern or a single unique delimiter with which to separate text by columns. I'm really sorry, we cannot help you with this.

  7. Hi,
    I wondering if you could help me out with this.

    I have a column with alphabets "A","B","U" and blanks . "A" means Main part ; "B" means Sub Part; "U" means Miscellaneous.
    I want the descriptions of the alphabets in the next column. Is there a way?

    Many thanks!

      1. Thanks very much!

  8. Hi ! Thank you for all the information.

    My case is a bit tricky.

    I want to extract the address of a string of many different characters.
    Eg - From:

    “ [ { code: “ABC” } ; { value : “123” } ; { name : “ABC” } ; { code: “XYZ” } ; { value : “&$)
    ” } ; { Address : “5 Conrad Street 2710” } ; { code dit : “JDI<-” } ; { value : “123” } ; { name : “$;&;7:?” } ;] “

    I want to only have the address - 5 Conrad Street 2710.

    Note that the number of characters of the address will vary. But the characters right before and after will be the same
    Before : Address : “
    After : ” } ; { code dit :

    Is there a way to do that ? Thank you !

    1. Hello!
      Use the advice from the article above. Extract text after certain characters. Then, in the resulting text string, extract the text before certain characters.
      Try this formula:

      =LEFT(RIGHT(A2,LEN(A2)-SEARCH("Address : ",A2)-10), SEARCH("} ; { code dit :",RIGHT(A2,LEN(A2)-SEARCH("Address : ",A2)-10))-3)

  9. I have a cell A2 that has ABC COMPANY #332; DEF COMPANY #254. I need to extract the 4 character numbers #332 and #254. I would like multiple columns to pull in each instance. I can successfully get the 1st instance using the formula

    =TRIM(LEFT(SUBSTITUTE(MID(A2,FIND("#",A2),LEN(A2))," ",REPT(" ",4)),4)) will result in #332

    How can i pull in the 2nd instance #254 in another column?

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =MID(A2,SEARCH("$", SUBSTITUTE(A2,"#","$",2)),4)

      1. Thanks, this is working. is there a way to add a qualifier to only return values that have a # followed by numbers and NOT include any instances where a # is followed by letters?

        Example

        #332; #FGH; #254

        Return #254 instead of #FGH

  10. Please help on how to extract or split if the start of the characters are the same?
    Example I want to extract only the words after the second "20L" which is ERASE on below.
    9D21461T5580739.11PHMC1020LP4ETR20LERASE

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

      =MID(SUBSTITUTE(A2,"20L","#",2), SEARCH("#",SUBSTITUTE(A2,"20L","#",2))+1,50)

  11. What about if the two characters are different? Which character do you put where?
    For example I am looking to to pull out just "240" from the string "200- COGS : 240 - Prof Services Mgmt" in a different cell. In this example, I'm looking for the section of the string between the "-" character and ":" character.

    I'm using the formula =MID(F2, SEARCH(":",F2) + 1, SEARCH("-",F2,SEARCH("-",F2)+1) - SEARCH(":",F2) - 1), but I think I need to change around the "-" and ":", but not sure where. I am always needing to break out these 4 pieces of information from a string like this and it takes forever. So if someone could tell me the best formula to use to get each of the pieces of information (200, COGS, 240, Prof Services Mgmt), that would be really helpful!
    Thanks!

  12. Hi,
    Can you please help in excel?
    I want to extract the date from a cell and is it possible the word "Date" would be appearing every time just before the date.
    I extracted the last 8 characters that contains date (Example of that text --> JSB-EPP-005253-23052022) but the requirement of the format is not achieved. Last 8 characters should be displayed in the assigned cell as "Date: 23.05.2022)".
    If this is possible, so please guide me how it would be implemented.
    Appreciate your great work,

    Thanks & Warm Regards,
    Ali

      1. Thank you very very much...this Formula worked great and fulfilled my all requirement :)
        I once again appreciate and bundle of thanks Dear Sir..

  13. if I have sentence in one cell, for example :
    1. I want to got to "Market"
    2. Yesterday, "Old lady" passed away
    3. "Car" is expensive

    How do you take only the word in between " " sign and copy to other cell (in this case word : Market, Old lady, Car)

    Thank you

    1. Hi!
      Pay attention to the following paragraph of the article above – How to extract text between two instances of a character. It covers your case completely.

  14. I'm needing to use this for a set of data that sometimes has multiple words in a cell, but not always. I've tried nesting it in an IF formula, but I've gone wrong somewhere. What I have works if there are spaces, but not if there aren't.

    Sample data set:
    Cat
    Brown dog
    Mixed-breed dog

    I would like to get the following results:
    Cat
    Brown
    Mixed-breed

    This formula (where A16 is the original cell) works for the second two, but not the first.
    =IF(SEARCH(" ",A16),LEFT(A16,SEARCH(" ",A16)-1),A16)

      1. That's worked! Thank you!

  15. Hi...!!
    I want to check a cell by formula "if a cell contains FORMULA in itself or not".
    I am using Excel 2010 so "ISFORMULA" function is not workable for me.

    Please advise.

    1. Please advise

  16. Hi

    I hope you can help me with this kind sir

    In column one, I have a list of tracking numbers that looks like this:

    123456
    123456
    123456
    123456
    12345678
    12345678
    12345678
    1234567
    1234567
    12345
    12345
    12345

    Suppose all FedEx trackings are 7 digit numbers, USPS are 8 digits length, DHL are 6 and XPO are the ones with 5 digits.
    What I'm trying to do is finding all USPS trackings and extract em from colum 1 to column 2, then, find all FedEx trackings and extract em to column 3, then find all the DHL tracking numbers to column 4 and so on.
    Is there a formula for that? Like, one that find all values of a given amount of digits (or characters) in a column and list em in a different column?

    Thanks in advance!

    (Sorry for the spam, I wasn't sure if I have replied to someone's comment lol)

  17. I am looking to extract the text after MA_

    RURAL_BUILD_FTTP_28B_FTTP_MA_PCPV9135_ON69848_AGN_SPN_CBT_RURAL_VA1
    RURAL_BUILD_28B_FTTP_MA_PCPV9152_POLING_CIVILS_VA1
    RURAL BUILD FTTP 30A_FTTP_MA_PCPV9058_MICS_CIVILS_VA1
    RURAL BUILD_29A_FTTP_MAIDSTONE_MA_PCPV9027_TEST ROD AND ROPE

    Ideally I would like a return of only the V*** after PCP

    Any help would be greatly appreciated

  18. Please How do i extract group of numbers appearing in in different positions of a different cells.
    Example;
    A
    ABSTV234 K:50s
    sg789nvhn092h
    satcads15qw20

    B(outcome)
    234
    789
    15

  19. "1970000.
    00"
    how to remove 1st and last 4th char in excel. i excel sheet it is hot showing same.
    in excel is display as 1970000.00
    i have tried right, left, char, find & replace, int, roundup & etc.
    pls help me it is taking lot of time.

  20. Hi Dear,

    Can you please help me to extract the text using excel logic

    791541213823202211Towage10120
    80292721355020228Charts/Publications10.11
    80292721355020228Class Certificates / Survey fee (DNV, Lloyd's, GL) / ISM250
    80292721355020228Port Costs1897
    80292721355020228Port Costs2116.8
    80292721355020228Port Costs4.7
    80292721355020228Port Costs66.69
    80292721355020228Waste Disposal1639.28
    90301491169020229Mooring Unmooring1003.89
    903643010118Federal Goods and Services Taxes (GST)1633.41
    903643010118Federal Goods and Services Taxes (GST)1834.4
    903643010118Federal Goods and Services Taxes (GST)2035.4
    903643010118Federal Goods and Services Taxes (GST)218.28
    903643010118Federal Goods and Services Taxes (GST)230.02

  21. 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

  22. 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)

  23. 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

  24. Excellent content as usual

  25. 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.

  26. 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.

  27. 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.

  28. 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

  29. 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.....

  30. 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?

  31. 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.

  32. 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 ?

  33. 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

  34. Super helpful. Thanks

  35. 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.

  36. 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

  37. 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"

  38. 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

  39. 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.

  40. 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

  41. 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.

  42. 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.

  43. 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?

  44. 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"

  45. 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!

  46. 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.

  47. 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?

  48. 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

  49. 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

  50. 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.

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 :)