laitimes

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

Little E has prepared this article supporting case files (including code), Excel essential toolbox and square grid installation package for everyone,

Receive a direct attention to the male brown number [Autumn Leaf Excel], reply to [1020]!

Hello everyone, I've been busy lately to flying green water zero.

Some time ago, colleague Xiao Wang asked me for advice: How to extract pinyin initials in Excel?

Because every time you update customer information, you need to enter the customer's full name to retrieve:

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

This is very inconvenient, so he wants to extract the first letter of the name for search:

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

This requirement looks quite difficult, but it is not a problem to achieve it, and there are still many methods

Let the Word Brothers take a shot, or use VBA, and all kinds of Excel plugins!

<h1 class="pgc-h-arrow-right" data-track="21" >01 Word+Excel brotherhood method</h1>

❶ Copy the name column and paste it to Word in a "keep text only" fashion.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❷ Use Ctrl+H to open the Find and Replace window, click the "More (M)" button, check "Use wildcards", and fill in the English character question mark "?" in the search content (represents any single character); in the replacement field, fill in "^&amp;" (note that ^is preceded by a space).

"^&amp;" refers to the original search for the content, the effect of adding a space in front of it, that is, adding a space in front of each character.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

Effects of the replacement:

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

The purpose of this substitution is to facilitate the extraction of the initials later, which is not necessary if it is only to be converted to pinyin.

❸ Select the content that needs to be converted to Pinyin, click the [Home] tab - [Pinyin Guide] - [OK].

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

After adding the effect of pinyin:

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❹ Copy and paste the converted pinyin back to Excel, and use the formula in column C to the right of the pinyin column (column B):

=PHONETIC(B2)

The role of the PHONETIC function is to extract the phonetics.

Then fill it down, so that the pinyin is extracted.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❺ Copy the Pinyin area, paste the results of the formula area as values, and then use the Columnization function of the Data tab to split the Pinyin into multiple columns in word units.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❻ Use the Left function to extract the initials of pinyin.

The left function starts from the left and extracts the number of characters that are needed, because we only extract the first letter, so the second argument can be defaulted, and then use &amp; to stitch.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

This method does not require any plug-ins or code, but the steps are a bit much.

Next, let's look at PlanB, the VBA custom function method.

<h1 class="pgc-h-arrow-right" data-track="70" >02 VBA custom function method</h1>

❶ Press [Alt+F11] to open the VBA editor, right-click in the left project window, and insert the module.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❷ Paste the code into the window for Module 1 and close the VBA Editor. (See the end of the article for the code acquisition method~)

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

❸ Use the custom function pyszm() to get the first letter of pinyin.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

Isn't that a lot simpler! After all, writing code to lose hair, let the big guys do it, we just need to stand on the shoulders of the big guys and be lazy.

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

But! There are more convenient ways to oh ~

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

Our public account has recommended several plugins, which can also be used to extract the initials~

<h1 class="pgc-h-arrow-right" data-track="92" >03 plug-in method</h1>

Here is the demonstration of excel must-have toolbox, interested in this plug-in small partners can take a look at our public medium [Autumn Leaf Excel] past articles ↓↓↓

Still working overtime for Excel? Come and try this freeware and click the mouse to get most of the day working!

❶ Select the name area to be converted;

❷ Click [Toolbox] tab - Other functions - Chinese characters to Pinyin;

❸ Select "Just Pinyin Initials" for the conversion method, uncheck "Add Space", click [Batch Convert Selected Areas], and get it!

It turns out that simple pinyin can still be played by Excel so many tricks! (Practical) 01 Word+ Excel Brothers Joint Method 02 VBA Custom Function Method 03 Plug-in Method 04 Summary

<h1 class="pgc-h-arrow-right" data-track="103" >04 summary</h1>

❶ Word has a limited number of functions to extract pinyin, taking Office 365 as an example, you can extract 90 characters (note that the characters contain characters such as spaces and line breaks), so it is not very efficient when extracting pinyin in batches.

The code for ❷ VBA may not be able to cover all characters, but it should be sufficient for everyday use.

❸ The plug-in demonstrated in the case is free, and the square grid can also implement this function, but the square grid is charged for a fee.

Although the method of Word is a little cumbersome, it uses the functions of Word and Excel itself to achieve the method of extracting pinyin, and there is no requirement for the version

Do you know anything else that may be a bit off-the-beaten-path, but fun or useful features? Welcome to share in the message area~