Excel Formula: Extract City Name from Description. Excel Magic Trick 1839

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 88

  • @excelisfun
    @excelisfun  Год назад +11

    Next week, I will show the Power Query Method!

    • @davidkoo2503
      @davidkoo2503 Год назад

      Challenge accepted will try to solve it in power query by next week... But this was great

  • @ExcelHechoFacil
    @ExcelHechoFacil Год назад +1

    I love your videos! Thank you for returning to the channel, I hope everything goes well with your beloved mother. A hug and a lot of strength.

    • @excelisfun
      @excelisfun  Год назад

      I am happy to boomerang back. I am still helping Mom so I will just post one video each Wednesday for a while : )

  • @joeswright86
    @joeswright86 Год назад +1

    That's the neatest Excel solution I have seen in a while. Great example of spilled arrays.

    • @excelisfun
      @excelisfun  Год назад

      Glad it is neatest for you : ) : )

  • @zt.5677
    @zt.5677 Год назад

    Thank you! I just love combining/compounding Excel functions. There is so much productivity here. Thank you for showing us these great things.

  • @Luciano_mp
    @Luciano_mp Год назад +1

    Good health to your mother and the whole family! Thanks Mike!

    • @excelisfun
      @excelisfun  Год назад

      Thank you, Luciano : ) : ) You are welcome!!!

  • @lucaviglio1206
    @lucaviglio1206 Год назад +1

    Wow Mike, so smart...i had not understood why using look up function but now it is clear, amazing

    • @excelisfun
      @excelisfun  Год назад +1

      The original lookup function from 1979 still has great uses : ) LOOKUPisfun!

  • @fernando5166
    @fernando5166 Год назад +1

    Excellent teacher Mike, for giving us several solutions

  • @GeertDelmulle
    @GeertDelmulle Год назад +4

    That is effective and efficient, right there!
    Thanks for this Golden Nugget, Mike. 🙂

    • @GeertDelmulle
      @GeertDelmulle Год назад +1

      Mike, since the challenge mentioned data cleaning, here's a simple PQ-M code that does the same:
      let
      Source = Excel.CurrentWorkbook(){[Name="fData"]}[Content],
      dCity = Excel.CurrentWorkbook(){[Name="dCity"]}[Content][City],
      GetCity = Table.AddColumn(Source, "City", each let desc = [#"Description (Only One City Name)"] in List.Select(dCity, each Text.Contains(desc,_)){0}, type text)
      in
      GetCity

    • @excelisfun
      @excelisfun  Год назад +1

      @@GeertDelmulle , Cool! That looks like similar logic to my approximate match lookup formula. My video next Wednesday uses List.Accumulate because it seems faster. I learned this from you!!!! : ) : ) I will show:
      = Table.AddColumn(AddDataTypes, "City", each List.Accumulate(Cities,"", (i,a) => if Text.Contains([Description],a) then a else i))
      or if there are multiple names:
      = Table.AddColumn(GetCityName, "CityWithDups", each Text.Trim(List.Accumulate(Cities,"", (i,a) => if Text.Contains([Description],a) then i&" "&a else i)))

    • @excelisfun
      @excelisfun  Год назад +1

      Barry Houdini at Mr Excel Message Board ; )

  • @Vandalfoe
    @Vandalfoe Год назад +1

    Kudos to you for you giving props to somebody from 13 years ago! (and for being such a good son)! ❤
    This is a good tip with a nice combination of old and new! 👌

    • @excelisfun
      @excelisfun  Год назад +1

      It is funny, but I tend to remember many of the key concept tricks that I learned from people. It was like a gift when I learned it from them, so I usually remember. Or at least I try to remember lol

  • @gvitullib
    @gvitullib Год назад +2

    Thanks Mike! 3 amazing solutions. I like the INDEX - MATCH Variant. Big fan of these 2 functions.

    • @excelisfun
      @excelisfun  Год назад +1

      INDEX and MATCH can do almost any type of lookup possible : ) : )

  • @ExcelStrategy
    @ExcelStrategy Год назад +1

    The pure Lookup solution makes me so nostalgic !

    • @excelisfun
      @excelisfun  Год назад

      Riiiight, back to 1979, when Briklin and Frankston created it to do their taxes : ) : ) : )

  • @Excelambda
    @Excelambda Год назад +6

    Great video!!
    BYROW iterates by nr. of rows, we can use REDUCE, a formula that iterates only 6 times no matter how many rows the vector has=> more efficient
    =REDUCE("",G7:G12,LAMBDA(v,i,v&IF(ISNUMBER(SEARCH(i,B7:B62)),i,"")))
    Also will be noticeable if there are more than one city/cell

    • @ricos1497
      @ricos1497 Год назад +2

      Yes! That's a good one. I always forget about reduce, it's got some great uses.

    • @viktorasgolubevas2386
      @viktorasgolubevas2386 Год назад +2

      👌

    • @KishoreKumar-of7sb
      @KishoreKumar-of7sb Год назад +1

      If More than one city. It join the City without space or delimiter.

    • @Excelambda
      @Excelambda Год назад +5

      @@KishoreKumar-of7sb The hypothesis and the solution of the video are obvious for scenarios of single cities per sentence, not for multiples.
      My formula was designed to increase only the efficiency and not the functionality. And even if no extra functionality was added, still offers the advantage that is "noticeable" when there are mult. matches Therefore I have used the word "noticeable" and not " can deal with multiple matches".
      Solving the delimiter "problem" is indecently simple and was not the purpose of the formula. Now that you mention it you force me to also increase the functionality. 😊
      =REDUCE("",G7:G12,LAMBDA(v,i,v&IF(ISNUMBER(SEARCH(i,B7:B62)),IF(v="","",",")&i,"")))
      edit after Mike's last post(YT did not show it as regular reply):
      "Glad you liked it!!✌ The reason I avoided space and TRIM is because of composed cities like "San Francisco" (or Las Vegas, Los Angeles) that has spaces already. Looks better with other delim plus on a later task you can count the cities based on other delimiter that is not space 😉"

    • @KishoreKumar-of7sb
      @KishoreKumar-of7sb Год назад +1

      The improvements to the function are commendable.
      @@Excelambda

  • @ahmedabdi5160
    @ahmedabdi5160 Год назад +1

    Thanks Mike, this has much extent than what I was using search,isnumber,Filter

    • @excelisfun
      @excelisfun  Год назад

      You are welcome! Sometimes the old school is the best : )

  • @hazemali382
    @hazemali382 Год назад +1

    always More than Great Mr. Mike

  • @SyedMuzammilMahasanShahi
    @SyedMuzammilMahasanShahi 9 месяцев назад

    Thanks Mike for this EXCELlent video.

  • @nsanch0181
    @nsanch0181 Год назад +1

    Thank you Mike for the neat lookup formula. The big number concepts 2^15 are so interesting. I remember seeing them for the first time in Ctrl+Shift+Enter. (9.99999E+307 and Match OMega character. I thought that was soo creative.

    • @excelisfun
      @excelisfun  Год назад +1

      I first learned the bib number concept from Aladin at the Mr Excel Message Baord : )

  • @josh_excel
    @josh_excel Год назад +1

    This is a great solution. It seems like Excel should make a built-in function to make this even easier.

    • @excelisfun
      @excelisfun  Год назад +1

      Glad you like this Barry Houdini solution, Josh Excel : )

  • @nadermounir8228
    @nadermounir8228 Год назад +1

    Amazing solution Mike. Thank you for this awesome video 📹 :)

    • @excelisfun
      @excelisfun  Год назад +1

      You are welcome, Nader!!! : )

  • @chrism9037
    @chrism9037 Год назад +1

    So awesome, thanks Mike!!

  • @johnborg5419
    @johnborg5419 Год назад +1

    Thanks Mike. That was an amazing solution.

    • @excelisfun
      @excelisfun  Год назад

      I bet you have seen this before, Formula Guy John : ) : ) : )

    • @johnborg5419
      @johnborg5419 Год назад +1

      @@excelisfun Yes. You had other similar videos.

    • @excelisfun
      @excelisfun  Год назад

      @@johnborg5419 I knew that you knew ; )

  • @abdiazizibrahim9163
    @abdiazizibrahim9163 Год назад +1

    Hi Mike,
    I can not thank you enough to be honest for your videos.

  • @tenamsb686
    @tenamsb686 Год назад +1

    Awesome as always!! 🎉

  • @Johnnydizzlefoshizle
    @Johnnydizzlefoshizle Год назад

    I was able to figure this out on my own thanks to your teachings. How would you do that with multiple results that you concatenated into a single cell?

  • @KevinPGA
    @KevinPGA Год назад +2

    Amazing combination of old and new! Thank you Professor. 👍👍👍

    • @excelisfun
      @excelisfun  Год назад +1

      You are welcome for the old and new : ) : )

  • @roywilson9580
    @roywilson9580 Год назад +2

    Great video, thanks Mike. The old-school Lookup function is great but even better used with the some of the newer functions. The power query method should be an interesting video too. Doing it with the new py functionality would also be an interesting challenge. I would be interested to know you think of the ability to use python on the grid in Excel and whether you plan to produce any videos dealilng with the new functionality when your family circumstances allow.
    I hope your mom is recovering well from her ill-health.

    • @excelisfun
      @excelisfun  Год назад +2

      I do not know python. Bad timing with writing my books (which are on hold now cuz of my Mom) and having to temp. move to California to take care of my Mom, has not allowed my to learn and make videos about python. I look forward to doing it, becasue it can bring such power. So for the time being, you will have to check out the other Excel MVP videos about this amazing new ability of Excel.
      Thanks for the well wishes, Roy!!!!

    • @roywilson9580
      @roywilson9580 Год назад +1

      @@excelisfun python functionality is certainly redrawing the map especially for charting. At the moment there are a few things I would change with the implementation the main one being to allow access to a local python installation to avoid sending everything to the cloud. There are some useful tutorials out there from other MVPs for low level functionality, but I much prefer your enthusiastic style and real world examples.
      I look forward to seeing your response to the latest innovations in Excel when your family responsibilities allow you time.
      I am sure many of us older followers of your channel fully understand the dificulties of balancing family responsibilities with a career and outside interests so will remain faithful to your channel.

  • @Surachetphunsawat
    @Surachetphunsawat Год назад +2

    Thank you

  • @florincopaci6821
    @florincopaci6821 Год назад +1

    Hi Mike
    Thank you for another usefull video.
    Could you please suggest me a function or other functions in excel 2021 with which I can replace chooserows function from Microsoft 365?
    Please.All the best

    • @excelisfun
      @excelisfun  Год назад

      INEX can lookup a single column or row. =INDEX(H22:L32,0,3) looksup column 3, =INDEX(H22:L32,3,0) looks up row 3.

    • @florincopaci6821
      @florincopaci6821 Год назад +1

      @@excelisfun Perfect.Thank you for the answer

  • @pistol1154
    @pistol1154 Год назад

    hi mike, thank you for share your knowledge, this works for Mac or i should work with windows pc or laptop?

    • @excelisfun
      @excelisfun  Год назад

      I have no idea. Given the demands of the working world, I stopped using my beloved Mac in 1997. I have not used one since and do now know : (

  • @VijayKumar-zd7ou
    @VijayKumar-zd7ou Год назад

    Sir how to live stock price reflect in excel like stock market and working on it for algo trading please make this video because I know that u do that everything in excel😊

    • @excelisfun
      @excelisfun  Год назад

      I am taking care of my Mom for a few months and I can't make videos. The videos posted over next four weeks are pre-posted. But you can try to post your question to the mrexcel.com/board web site, which is the best question site I konw : )

  • @DataDashPro
    @DataDashPro Год назад

    Mike consider we have a cell on which we type age like 6-9 (Six year nine month). we have a table which has a age interval columns like 6-0 to 6-5 6-6 to 6-11 7-0 to 7-5 7-6 to 7-11. how actually we get column number to match. mean lookup and get column number. Please share some thoughts. thank you.

    • @excelisfun
      @excelisfun  Год назад +1

      I would build a lookup table with all possibilities. For example, if 6-0 to 6-5 returns a lookup value of 22, then build the lookup table as:
      6-0, 22
      6-1, 22
      6-2, 22
      6-3, 22
      6-4, 22
      6-5, 22
      and so on.
      Use Exact Match
      You can build your lookup table across columns or rows.
      There are formulas to do what you want, but they are crazy. Sometimes, the best solution is to change the data or lookup table setup.

    • @Excelambda
      @Excelambda Год назад +2

      "lv" lookup_value (the array where you have format "6-9" values)
      "la" lookup_array (the vector where you have format "6-0 to 6-5" values)
      "ra" return_array (corresponding matching values for respective intervals of "la" )
      then you can use a single cell simple formula, no other transformation needed
      =XLOOKUP(IF(LEN(TEXTAFTER(lv,"-"))=1,SUBSTITUTE(lv,"-","-0"),lv),SUBSTITUTE(TEXTBEFORE(la," "),"-","-0"),ra,,-1)
      if you need only clm/row nr. XMACH does the trick:
      =XMATCH(IF(LEN(TEXTAFTER(lv,"-"))=1,SUBSTITUTE(lv,"-","-0"),lv),SUBSTITUTE(TEXTBEFORE(la," "),"-","-0"),-1)

    • @DataDashPro
      @DataDashPro Год назад

      @@Excelambda how this function return a matching value . consider lookup value is 6-3 and we have column lable as 6-0 to 6-5 how formula will return true for match?

    • @Excelambda
      @Excelambda Год назад +1

      @@DataDashPro Works fine because aproximate match is not only for numbers , works with any values that can be compared, text strings included.
      Check it, works perfectly fine.

    • @excelisfun
      @excelisfun  Год назад +1

      @@Excelambda "single cell simple formula" lol Awesome, Excel Lambda!!!!!

  • @shehzadahmad8658
    @shehzadahmad8658 6 месяцев назад

    what if we didn't have a list of cities, then how can we extract city name from a column of raw data

  • @oliviamutelet7052
    @oliviamutelet7052 2 месяца назад

    no working, Its says #N/A