从组件构造ID字符串,包括名称中的第一个和最后一个字母

时间:2015-02-26 22:32:33

标签: string excel excel-formula worksheet-function

我正在处理Excel文档,我需要一个公式的帮助。我的工作表设置如下:

Column A = First Names
Column B = Last Names
Column G = User ID

我需要用户ID采用以下格式:AOKxxxx01,按顺序:

x = first letter of first name
x = last letter of first name
x = first letter of last name
x = last letter of last name 

因此,对于Bob Smith,用户ID在第G列中显示为AOKBBSH01

第一个B是名字的第一个字母,第二个B是名字的最后一个字母,S是姓氏的第一个字母,{{ 1}}是姓氏的最后一个字母。周围的HAOK是不变的。

1 个答案:

答案 0 :(得分:1)

请尝试:

="AOK"&LEFT(A2)&UPPER(RIGHT(A2))&LEFT(B2)&UPPER(RIGHT(B2))&"01"