Extract Text From Nth Occurrence of a Space in a Cell

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 69

  • @sandivant
    @sandivant Рік тому

    THANK YOU! This is the ONLY video that has helped!

    • @Computergaga
      @Computergaga  11 місяців тому +1

      You're welcome! Glad I could help.

  • @aguerojg
    @aguerojg 10 років тому +3

    Excellent tutorial, Computergaga, the explanation can't be clearer. Thanks for sharing your knowledge!!

  • @veritymorris2079
    @veritymorris2079 6 років тому +2

    Super helpful! Very easy to follow and understand - thank you

  • @arq.gabrielamartinez7146
    @arq.gabrielamartinez7146 3 роки тому

    This video was awesome. Normally these tutorials bore me a bit... This one was so entertaining, haha. Love your energy!

  • @jtr12265
    @jtr12265 9 років тому

    Oh, thanks Computergaga. Thank God, I found this video. I was looking for this for several days. The trick you shared with us is really helpful. Keep up the sharing!

  • @AllerToGo
    @AllerToGo 3 роки тому +2

    What about if the "3" isn't fixed.... but it could be; 3,5,12,1,4 spaces from the left?

  • @babiechad
    @babiechad 2 роки тому

    a 7-year-old video I stumbled upon which helped me immensely! thank you!

  • @harshadvegda8097
    @harshadvegda8097 4 роки тому +1

    What a great solution suggested. Thanks a lot. I had been working hard to solve such issues. In spite of my many years of experience, mathematical skills I could never find a right solution. I have developed formulas but they are very clumsy and involving so many columns. Sir, Thanks a lot as it is solved in just one statement. Excellent Tutorial

  • @bayareanonsense506
    @bayareanonsense506 6 років тому +1

    came for the lesson stayed for the accent. this is brilliant and helpful; you approached it with the right attitude.

    • @Computergaga
      @Computergaga  6 років тому

      Thanks Erin.

    • @bayareanonsense506
      @bayareanonsense506 6 років тому

      i do have a question i'm trying to set the function to extract text from between two characters for ex: blah-blah-blah-blah_wordtoextract-moretext. i used your function =MID(A2,FIND("*",SUBSTITUTE(A2,"_"," * ",1)),5) but the names i need to extract go beyond 5 characters. how do i set the formula to only look for text between the "_" and "-"?

    • @Computergaga
      @Computergaga  6 років тому

      The formula below works for your example Erin.
      =LEFT(RIGHT(A2,LEN(A2)-FIND("_",A2)),FIND("-",RIGHT(A2,LEN(A2)-FIND("_",A2)))-1)
      It uses the RIGHT function to extract everything after the _ and then the LEFT function from that result to extract everything before the -.

  • @vandalo7494
    @vandalo7494 8 років тому

    Nice approach Computergaga.
    Before assist your video until the end, I tried my own approach where I should extract all the text before the numbers. So this was the formula I came up.
    {=left(A1,small(if(--(mid(A1,row(indirect("1:"&len(A1))),1)=" ")*row(indirect("1:"&len(A1)))=0," ",row(indirect("1:"&len(A1)))),3)-1)}
    BTW nice accent. I had no problem to understand you.

  • @soumyamohapatra646
    @soumyamohapatra646 4 роки тому +1

    Thank you!

  • @oliverdosramos8255
    @oliverdosramos8255 4 роки тому +1

    Love it thanks!

    • @Computergaga
      @Computergaga  4 роки тому

      You're very welcome. Thank you Oliver.

  • @kinkineki
    @kinkineki 3 роки тому

    This is great thanks for replying so quickly. Do you know how to do exactly this but with a Regextract formula? This formula doesn't translate well to Google data studio unfortunately

  • @pipo441
    @pipo441 Рік тому

    Beautifull

  • @ankan123jyoti3
    @ankan123jyoti3 9 років тому +1

    Thanks.. Your video really helped me a lot. But what if the length of the extracted data is variable. We cannot put 2 in that case. Please help!!

    • @Computergaga
      @Computergaga  9 років тому +1

      Ankan123 Jyoti You will need to locate the end of the string using Find and Substitute again maybe like this vid. Then subtract the position of first character from position of last character.

    • @ankan123jyoti3
      @ankan123jyoti3 9 років тому

      Computergaga Thanks.. Bcoz of your tutorial I figured to manage my excel.. Highly appreciated.

    • @soumyamohapatra646
      @soumyamohapatra646 4 роки тому

      @@ankan123jyoti3 Can you please help. I have the same query.

  • @robertbarker2023
    @robertbarker2023 4 роки тому

    Howdo you extract first, middle, last names and suffix such as Jr. into separate columns. Not everyone has a suffix nor does everyone have a middle name?

  • @maykwan5538
    @maykwan5538 4 роки тому

    Super!! Thanks

  • @soumyamohapatra646
    @soumyamohapatra646 4 роки тому +1

    One question here we are hard coding the number of characters to be extracted to 2. If my length is varying, how to make it dynamic. Like i have numbers like 38,532,6554. I want the code to extract these.

    • @Computergaga
      @Computergaga  4 роки тому

      We would need to also find the end of the characters to extract, and subtract the starting position to leave us with the number of characters. This would be used in the place of the 2.
      I have this video on extracting text between two characters which may also help - ua-cam.com/video/Yf-aqzuuQzE/v-deo.html

  • @jay55patel
    @jay55patel 4 роки тому

    thank you

  • @janlaubscher914
    @janlaubscher914 5 років тому

    Hi Computergaga, i am in need of some help, on this topic. the video gives a perfect explanation of how to get the information that i need from the string of text. but my string of text gets generated online, and will be refreshed daily where the numbers that i need extracted from the text will also change, in the way that the numbers get larger daily. is there a way to setup the formula so that it will automatically extract the number no matter how many characters it is?

    • @Computergaga
      @Computergaga  5 років тому

      Absolutely. You could use Power Query to import data from the web if you need a way, and this is refreshable. And then wit the formula you already have, possibly combined with something like this - ua-cam.com/video/Yf-aqzuuQzE/v-deo.html to locate the end of the numbers too. Then the length of numbers will not affect things.

    • @janlaubscher914
      @janlaubscher914 5 років тому

      @@Computergaga , thanks, i managed to find a way, had to use multiple formulas to get the results that i wanted, but it works now the way i want it to. i have been having a problem though with the data web query. as of late it keeps telling me that "the site reports that the request is not valid". any ideas on how to solve this issue as the hyperlink i am using does work in my browser but i cant get it to work in excel, even though it did at the beginning. all the formulas i put together to extract information from the text from the link is useless now as the link wont auto refresh to update the information i need.
      i would really appreciate any help i can get. have searched the web for days now and cant get a clear answer as to why its doing this, what is the cause or how to fix it so that the links work again. thanks in advance for any help or advice you can provide me with.

  • @kameshsharma5164
    @kameshsharma5164 3 роки тому

    Thanks sir, very helpful video. But I want to know whether we can extract more than one word. You have taught to extract one word from the middle of a line, in this video, but I want to get more than one word from a line.

    • @Computergaga
      @Computergaga  3 роки тому

      Sure. You would need a way to recognise the end of the words. Either a delimiter or a number of words.

    • @kameshsharma5164
      @kameshsharma5164 3 роки тому

      @@Computergaga
      Sir, I request you to please make a formula in which I can extract two or three words from the middle of the line of a cell in Excel. I have made different formulas for both, but I am not able to form a formula by mixing them both. I am sharing both those formulas with you. You are requested to mix these two and make a formula so that I can extract two or three or four words from a line in a cell. Please Please
      (To extract one word from mid of line)
      =Trim(MID(SUBSTITUTE(B6," ",REPT(" ",LEN(B6))),(C6-1)*LEN(B6)+1,LEN(B6)))
      (To extract 2 or 3 word from the starting of the line)
      =TRIM(LEFT(B1,FIND("~",SUBSTITUTE(B1," ","~",A1)&"~")))

  • @GilCuriously
    @GilCuriously 4 роки тому

    Hello. Instead of extracting, what function would you use to delete those two characters?

    • @Computergaga
      @Computergaga  4 роки тому

      The SUBSTITUTE function would be used to remove characters using a formula.
      If you want to remove them from the current cells, then use the Find and Replace tool.

    • @martinsger
      @martinsger 4 роки тому

      IN TIME OF PANDEMY, SEE RESOLUTION: =SUBSTITUTE(A13,MID(A13,FIND("*",SUBSTITUTE(A13;" ","*",3))+1,2),"")

  • @mohanpal13555
    @mohanpal13555 5 років тому

    Awesome vedio sir

  • @50majeedkhan
    @50majeedkhan 3 роки тому

    If number start with on letter also please

  • @monikakrausuk
    @monikakrausuk 3 роки тому

    What if the number can be 1 digit or 3 digits and more instead of only 2? How would that work?

    • @Computergaga
      @Computergaga  3 роки тому +1

      Hi Monika, the following will work. On th question where we entered 2, we use the FIND and SUBSTITUTE again to find the difference between the fourth occurrence of a space and the third occurrence of a space.
      =MID(A1,FIND("*",SUBSTITUTE(A1," ","*",3)),FIND("?",SUBSTITUTE(A1," ","?",4))-FIND("*",SUBSTITUTE(A1," ","*",3)))

    • @jumbyto
      @jumbyto 2 роки тому

      @@Computergaga extract number from a text :
      * replace A2 with whatever destination of extraction you need
      =SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)) * ROW(INDIRECT("1:"&LEN(A2))), 0), ROW(INDIRECT("1:"&LEN(A2))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(A2)))/10)
      Take care

  • @imranali-iy5wk
    @imranali-iy5wk 6 років тому

    sir I have some problem in excel I have a hudge data of names that is one lakh plus I want to found those names which have no space

    • @Computergaga
      @Computergaga  6 років тому

      I don't completely understand the question Imran. You have a list of names with and without spaces and a lakh in the same column. And you want the names without spaces?
      Sounds complex. Depending on the names involved, possibly almost impossible to automate as names are so random in length and structure.

  • @khuntiaachyutanan7316
    @khuntiaachyutanan7316 4 роки тому

    if i will try extract 38 Orange from the sentence red yellow blue 38 Orange , how is formula

    • @Computergaga
      @Computergaga  4 роки тому +1

      I would use Power Query. It has an option to split column from a number.

    • @khuntiaachyutanan7316
      @khuntiaachyutanan7316 4 роки тому

      Great sir, but it is out of excel formula

    • @martinsger
      @martinsger 4 роки тому

      IN TIME OF PANDEMY, SEE RESOLUTION: =SUBSTITUTE(A13,MID(A13,FIND("*",SUBSTITUTE(A13;" ","*",3))+1,2),""), THE 38 WILL DELETED

  • @jumbyto
    @jumbyto 2 роки тому

    Good job, but maybe you need a certain text like 3542 or 5 .... there you go as an assist to this problem :
    =SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)) * ROW(INDIRECT("1:"&LEN(A2))), 0), ROW(INDIRECT("1:"&LEN(A2))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(A2)))/10)

  • @mattmcmhn
    @mattmcmhn 5 років тому +1

    This is good, but really misses the power of doing a substitute to count spaces. In this example there's 0 reason to not just copy the column, text to columns, and grab the 4th column since the formula completely relies on the data you want always being after the 4th space from the beginning. Where using substitute is really useful is in text strings where there are a varying number of spaces, but your data that you want to pull out is at the beginning or end of the string and you want to disregard the middle.
    An example would be a string with say a customer number, then name and address, then maybe a date and amount at the end. You want the customer number, date, and amount, but the name/address information obviously has a varying number of spaces. You know the date and amount are always between the last two spaces from the end, so this formula would be modified to count the number of spaces in the cell and then return the information between the second and first space from the end, and the last space from the end.

    • @Computergaga
      @Computergaga  5 років тому

      Thank you Matt. SUBSTITUTE is such a useful function, there are many instances of its benefits.
      When compared to using Text to Columns instead, the key difference is that the formula automates the solution. Someone would need to manually perform Text to Columns each time. So it all depends on the regularity of the task.

  • @kameshsharma5164
    @kameshsharma5164 3 роки тому

    Sir, I request you to please make a formula in which I can extract two or three words from the middle of the line of a cell in Excel. I have made different formulas for both, but I am not able to form a formula by mixing them both. I am sharing both those formulas with you. You are requested to mix these two and make a formula so that I can extract two or three or four words from a line in a cell. Please Please
    (To extract one word from mid of line)
    =Trim(MID(SUBSTITUTE(B6," ",REPT(" ",LEN(B6))),(C6-1)*LEN(B6)+1,LEN(B6)))
    (To extract 2 or 3 word from the starting of the line)
    =TRIM(LEFT(B1,FIND("~",SUBSTITUTE(B1," ","~",A1)&"~")))

  • @radhakrishnanradhakrishnan2122
    @radhakrishnanradhakrishnan2122 4 роки тому

    Sir,
    I have need first space & second space between text
    Example:
    GGG hhh ffff-hhh
    GGG hhhh

    • @martinsger
      @martinsger 4 роки тому

      IN TIME OF PANDEMY, ITS THE FORMULA: =LEFT(A6,FIND(" ",A6)-1)&" "&MID(A6;FIND(" ",A6)+1,(FIND(" ",A6;FIND(" ",A6)+1))-FIND(" ",A6)-1) .