我有这种格式的信息(以空格分隔):
CustomerNbr Employee Employee Employee Employee
1234567890 Martha.Stewart Tom.Brady Master.Chief Bart.Simpson
2345678901 Martha.Stewart Tom.Brady Bart.Simpson
3456789012 Martha.Stewart Master.Chief
4567890123 Tom.Brady Bart.Simpson
5678901234 Tom.Brady Bart.Simpson
6789012345 Tom.Brady
7890123456 Martha.Stewart
8901234567 Master.Chief
9012345678 Master.Chief
我需要它采用这种格式(空格分隔):
Employee CustomerNbr CustomerNbr CustomerNbr CustomerNbr CustomerNbr
Martha.Stewart 1234567890 2345678901 3456789012 7890123456
Tom.Brady 1234567890 2345678901 4567890123 5678901234 6789012345
Master.Chief 1234567890 3456789012 8901234567 9012345678
Bart.Simpson 1234567890 2345678901 4567890123 5678901234
有办法做到这一点吗?到目前为止,我搜索无济于事。我们的想法是翻转它们之间的关系,但我找不到通过excel的方法,也不了解宏做这么复杂的事情。
我找到的最近的是:Return column header based on row header and cell value
答案 0 :(得分:1)
A3:A11
:初始表。
A15
:员工姓名(“Martha.Stuart”)
B15
:数组公式(在公式窗口中按Ctrl-Shift-Enter插入;曲线括号将由Excel插入,而不是由用户插入):
{=LEFT(OFFSET($A$1;SMALL(IF(NOT(ISERROR(SEARCH(" "&$A15&" ";$A$3:$A$11)));ROW($A$3:$A$11);IF(ISERROR(SEARCH(" "&$A15;$A$3:$A$11))=FALSE;IF(SEARCH(" "&$A15;$A$3:$A$11)=LEN($A$3:$A$11)-LEN($A15);ROW($A$3:$A$11);65000)));B$14)-1;0);10)}
示例电子表格:http://www.bumpclub.ee/~jyri_r/Excel/Customer_number_transposition.xls