简体   繁体   English

Excel —第一行中的单元格值匹配,具有多列的一行中的返回值

[英]Excel — Cell Values Match in First Row, Return Values on One Row with Multiple Columns

Here's an explanation of what I'm having difficulty with: 以下是我遇到的困难的解释:

Column A: Lists the Address Book Numbers for different companies (1234, 1235, 1236, etc.) A列:列出不同公司的通讯簿编号(1234、1235、1236等)
Column B: Lists the Phone Types (Cell, Fax, Home) B列:列出电话类型(移动电话,传真,家庭电话)
Column C: Lists Company Phone Numbers C列:列出公司电话号码

Address Book Numbers from Column A are repeated in multiple rows (due to the fact that some companies have more than one Phone Number in Column C )... So, I'm looking to consolidate the Address Book Numbers that are the same (to one row) and have each phone number pertaining to the same address number in additional columns (within that row). A列中的 通讯簿编号在多行中重复(由于某些公司C列中有多个电话号码 )...因此,我希望合并相同的通讯簿编号 (以一行),并在其他列(在该行内)中将每个电话号码都属于同一地址。


Current Excel Table: 当前的Excel表:


AddressBookNumber  PhoneType  PhoneNumber
1234               CELL       (444)444-4444
1235               FAX        (777)777-7777
1234               OFFICE     (000)000-0000
1236               FAX        (222)222-2222
1234               HOME       (555)555-5555
1236               OFFICE     (111)111-1111

Would like my Excel Table to look like: 希望我的Excel表如下所示:

|AddressBookNumber | PhoneType1 | PhoneNumber1  | Phone Type2 | PhoneNumber2  | PhoneType3 | PhoneNumber3  |
|1234              |CELL        | (444)444-4444 | OFFICE      | (000)000-0000 | HOME       | (555)555-5555 |
|1235              |FAX         | (777)777-7777 |             |               |            |
|1236              |FAX         | (222)222-2222 | OFFICE      | (111)111-1111 |            |

Essentially, I need to have the phone numbers pertaining to one company all in one row.. would appreciate any assistance on the formula I should use. 从本质上讲,我需要将一间公司的电话号码全部放在一行中。 Thanks! 谢谢!

To get the unique list use this array formula put this in F2: 要获得唯一列表,请使用以下数组公式将其放在F2中:

=IFERROR(INDEX($A$2:$A$7,MATCH(0,COUNTIF($F$1:F1,$A$2:$A$7),0)),"")

Hit Ctrl-Shift-Enter on exit of edit mode instead of Enter. 在退出编辑模式时按Ctrl-Shift-Enter而不是Enter。 Then copy/drag down till you get blanks. 然后复制/向下拖动直到出现空白。

And to get the numbers put this in G2: 并将数字放入G2:

=IFERROR(INDEX($B$2:$C$7,MATCH(1,(COUNTIFS($E$2:E2,$B$2:$B$7,$F$2:F2,$C$2:$C$7)=0)*($A$2:$A$7=$F2),0),MOD(COLUMN(A:A)-1,2)+1),"")

Hit Ctrl-Shift-Enter on exit of edit mode instead of Enter. 在退出编辑模式时按Ctrl-Shift-Enter而不是Enter。 Then copy/drag down and over till you get blanks. 然后向下复制/拖动,直到获得空白。

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Excel - 如何将一个单元格与两列中的值进行比较以返回满足等式的行的索引? - Excel - How to compare one cell with values from two columns to return the index of the row that satisfies the equation? Excel-从一列中水平返回一行中的多个匹配值 - Excel - Return multiple matching values from a column, horizontally in one row 如何连接单元格值,直到在 Excel 中找到空白,然后在段落的第一行返回结果? - How to concatenate cell values until it finds a blank in Excel then return the result in the first row of the paragraph? Excel —从值列表中过滤第一行; 对于多个值? - Excel — Filter the first row from a list of values; for multiple values? 基于excel中第一行值的单元格行到列的范围 - Range of cell rows to column base on first row values in excel 根据Excel中的前2个单元格值删除整行 - Deleting entire row based on first 2 cell values in Excel Excel VBA-查找一个单元格并将该行中的其他值返回到另一张表 - Excel VBA - find one cell and return other values in that row to another sheet 如何基于已知单元格返回Excel行和列标题值? - How to return Excel row and column header values based on a known cell? 如果月份和年份与该行中的dd / mm / yyyy格式的日期单元格匹配,则返回该行中的所有单元格值 - Return all cell values in a row if Month & Year match a dd/mm/yyyy formatted date cell in that row Excel。 如何将一列与多列的值相似但不完全相同的列进行比较,并显示可能匹配的行号 - Excel. How to compare one column to multiple ones, with similar but not exact values, and display the row number of the possible match
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM