Blog Post

Microsoft 365 Insider Blog
3 MIN READ

Improving five Excel text functions: LEN, MID, SEARCH, FIND, and REPLACE + Compatibility Versions

JakeArmstrong's avatar
JakeArmstrong
Icon for Microsoft rankMicrosoft
Dec 03, 2024

 

Hi, Microsoft 365 Insiders! I'm Jake Armstrong, a Product Manager on the Excel team. I'm thrilled to share some improvements to five of our text functions (LEN, MID, SEARCH, FIND, and REPLACE) that will make them work better with Unicode characters – plus, introduce Compatibility Versions, which will allow us to improve functions without changing the results in existing files. Try these improvements here.

Improving our text functions

Based on your feedback, we are updating the LEN, MID, SEARCH, FIND, and REPLACE functions to support Unicode surrogates. This has been a major pain point for international users and those who use emojis, because these five functions have been double-counting certain characters. This was inconsistent with our more modern text functions, which did not have this issue (including LEFT, RIGHT, TEXTBEFORE, TEXTAFTER and TEXTSPLIT).

Below you can see the existing behavior where LEN (🤔) = 2. That’s a bit confusing! 🤔

 

 

With this update, the LEN, MID, SEARCH, FIND, and REPLACE functions now count each character once, no matter what that character is.

To ensure that calculations in your existing workbooks don’t change, these improvements are being rolled out as Compatibility Version 2. Read on to learn more.

Introducing Compatibility Versions

To release improvements to functions while ensuring that workbooks continue to calculate as expected, we are introducing a new feature called Compatibility Versions.

Compatibility Versions are set per workbook. Version 1 reflects historical calculation behavior while Version 2 contains the improvements to text functions described above.

To  change a workbook’s Compatibility Version, select Formulas > Calculation Options > Compatibility Version

Compatibility Versions for existing files

Existing spreadsheets will be set to Version 1, so their calculations will remain consistent. Once a spreadsheet’s version has been set, it will not change unless you change it in through the menu described above.

Compatibility Versions for new files

As of today, new workbooks will be set to Version 1, but this will change to Version 2 after a transition period while it rolls out to all Microsoft 365 subscription users (January 2026 for Current Channel).

The version that is currently being set on new workbooks is called the Recommended Version. It should be considered the best option for most users and scenarios, because it will have the most improvements, yet be accessible by all Microsoft 365 subscription users.

See this help document for details on each version and the current Recommended Version: Compatibility Versions - Microsoft Support

Working with older versions of Excel

If you collaborate with others who are using non-Microsoft 365 Excel versions that predate this functionality (Excel 2024 and earlier), you can set the compatibility level to Version 1 to ensure consistency. Workbooks set to Version 1 will continue to calculate as they always have.

If a user opens a spreadsheet set to a version they do not have access to that contains functions that have changed, a warning will be shown indicating that calculation results may differ. Otherwise, the file will behave normally.

Future Compatibility Versions

Versions are cumulative, so include all changes from prior versions. For example, a future Version 3 will include the text function changes introduced by Version 2.

We’re excited to use Compatibility Versions to continue improving  Excel functions, while ensuring that your existing files continue to calculate consistently. You can expect each Compatibility Version to contain a batch of new improvements and will be detailed in this help document: Compatibility Versions - Microsoft Support

Availability

These functions are currently available to Beta Channel users running Version 2412 (Build 18317.20000) or later. Try these improvements here.

 

Features are released over some time to ensure things are working smoothly. We highlight features that you may not have because they’re slowly releasing to larger numbers of Insiders. Sometimes we remove elements to further improve them based on your feedback. Though this is rare, we also reserve the option to pull a feature entirely out of the product, even if you, as an Insider, have had the opportunity to try it.

Feedback

We are excited for you to experience these improvements, and we believe they will significantly enhance your productivity and experience with Excel!

 

We want to hear from you!

  • If you have any feedback or suggestions, you can submit them by clicking Help > Feedback in Excel. 
  • You can also submit new ideas or vote for other ideas via Microsoft Feedback.

 

Learn about the Microsoft 365 Insider program and sign up for the Microsoft 365 Insider newsletter to get the latest information about Insider features in your inbox once a month! 

Updated Jan 31, 2025
Version 4.0
  • Jignesh1567's avatar
    Jignesh1567
    Copper Contributor

    If in Cell A1 I have something like this: 😂👍🙌 and in cell B1 - I use formula =LEN(A1), result is still 6 not 3. So it seems need for further improvement. If I use =LEN("😂👍🙌") it correctly shows 3. But compare this with behavior of other similar functions which correctly produce results like =LEFT(A5,2). In B5, this formula correctly shows result as 😂👍. Also =RIGHT(A5,1) correctly shows 🙌. Similarly, tested TEXTBEFORE, which also shows result correctly. I am on beta 2504 (Build 18713.20002).

  • Hecatonchire's avatar
    Hecatonchire
    Iron Contributor

    Hello,

     

    Emoji may not be the right example

    With Emoji 32 bits

    Len("🧑‍🚀") =>5 (version1) or 3 (version 2)

    Does it really make more sense for the average person?

  • Hiro_A's avatar
    Hiro_A
    Copper Contributor

    It is a welcome and excellent improvement, but some challenges remain.

    For example, when an emoji is followed by a skin tone modifier, it visually appears as a single character, but in terms of Unicode code points, it consists of two characters.

    Furthermore, when a Kanji(Han) character is followed by an IVS (Ideographic Variation Sequence/Selector), it also visually appears as a single character, but in terms of Unicode code points, it consists of two characters.

    Under the proposed LEN version 2 specification, in both cases, the LEN function would returns 2, which corresponds to the number of Unicode code points.

    While there is undoubtedly a need to obtain the number of Unicode code points, there is also a need to retrieve the number of characters based on their visual appearance.

    A single character based on visual appearance corresponds to a single Unicode Extended Grapheme Cluster, which can be matched using the regular expression '\X'.

    I hope that future versions of the LEN function and its related functions will introduce an option to count the number of Unicode Extended Grapheme Clusters in addition to the  number of Unicode Code Points.

    • JakeArmstrong's avatar
      JakeArmstrong
      Icon for Microsoft rankMicrosoft

      This is good feedback. Our first step here was have these functions count Code Points in line with Unicode, but I hear you that it would also be valuable to be able to count Grapheme Clusters.

       

      As pointed out in this thread, Emojis didn't make for perfect examples, because they have Variation Selectors but we used them in this article because they're more universal across languages/locales.

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    Tip: To get the compatibility version number in a cell, you can use a formula like this:

    =IF(LEN("🖖🏿")=4,1,2)

  • Using of compatibility versions is great idea.

    The only, Lean More reference in drop-down doesn't work. 

    • MSArmelle's avatar
      MSArmelle
      Icon for Microsoft rankMicrosoft

      SergeiBaklan issue with the link has been resolved. Please give it another try. And here is the direct link: https://support.microsoft.com/en-us/office/compatibility-versions-49f5d3bf-d9a4-47a3-9db8-e776f664cbf9

  • JoeyF's avatar
    JoeyF
    Brass Contributor

    In what build of Excel for Mac should we see this change?

    • JakeArmstrong's avatar
      JakeArmstrong
      Icon for Microsoft rankMicrosoft

      It has not yet been released on Beta for Mac yet, but we hope to follow with that soon. We'll update this document with the version once that release goes through.