預(yù)覽該模板:
在日常工作過(guò)程中,我們常需要獲取漢字對(duì)應(yīng)的第一個(gè)字母,比如,學(xué)生用音序查字法查字詞典,醫(yī)院建立藥品查詢系統(tǒng),KTV建立歌曲查詢系統(tǒng)……有沒(méi)有辦法輕松獲取字詞的第一個(gè)字母呢?大家都知道ET和EXCLE可以按音序排列中文數(shù)據(jù),這就表明電子表格已經(jīng)能洞悉漢字拼音的第一個(gè)字母與其在漢字編碼系統(tǒng)的位置的關(guān)系了。只要查詢出漢字在編碼系統(tǒng)中的位置,并告知相同音序的漢字在編碼中的起始位置,電子表格就可以將漢字的音序輕松獲取。
想三秒鐘獲取漢字對(duì)應(yīng)的第一個(gè)字母就打開(kāi)你的WPS表格2012,跟我試試吧!
一、打開(kāi)原始工作簿,在準(zhǔn)備填充字母的列粘貼下列嵌套公式:
=LOOKUP(CODE(A2),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})
在這個(gè)公式中,CODE函數(shù)旨在查詢?cè)~語(yǔ)(字符串)第一個(gè)字符對(duì)應(yīng)的數(shù)字代碼,這些代碼其實(shí)標(biāo)明了這個(gè)漢字在代碼庫(kù)中的具體排位,LOOKP函數(shù)就根據(jù)不同音序漢字在代碼庫(kù)中的起始位置,獲取到這個(gè)漢字的第一個(gè)字母了。
其中,A2是引用漢語(yǔ)字詞所在的單元格名稱,大家可獲取字詞前兩個(gè)漢字所對(duì)應(yīng)的第一個(gè)字母根據(jù)實(shí)際情況修改。
二、如果你想獲取詞語(yǔ)第二個(gè)漢字對(duì)應(yīng)的字母,可以將上述公式中的A2改為MID(A2,2,1),表示從字符串的第二個(gè)開(kāi)始取的第一個(gè),即第二個(gè)。具體公式為:
=LOOKUP(CODE(MID(A2,2,1)),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})
如果想取第三個(gè)可以以此類推,即:
=LOOKUP(CODE(MID(A2,3,1)),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})
三、如果想獲取前兩個(gè)漢字音序怎么辦?用“&”將獲取第一、二個(gè)漢字音序的公式合并即可。如果想獲取前三個(gè)漢字音序就用“&”將獲取第一、二、三個(gè)漢字音序的公式合并。
獲取字符串前三個(gè)漢字音序的公式:
=LOOKUP(CODE(A2),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})&LOOKUP(CODE(MID(A2,2,1)),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})&LOOKUP(CODE(MID(A2,3,1)),45217+{0,36,544,1101,1609,1793,2080,2560,2902,3845,4107,4679,5154,5397,5405,5689,6170,6229,7001,7481,7763,8472,9264},{"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","W","X","Y","Z"})