我有一列数据,如下表 B 列所示。字母“A”表示软件,“B”表示服务,“C”表示硬件。如何将每种产品与其类别匹配,使其看起来像下表所示?
A B
--------------
Software A1
Software A2
Software A3
Software A4
Service B1
Service B2
Service B3
Service B4
Hardware C1
Hardware C2
Hardware C3
Hardware C4
我如何在 Excel 中实现这一点?
答案1
将此公式复制到A1
并使用自动填充。
=IF(LEFT(B1,1)="A","Software",IF(LEFT(B1,1)="B","Service",IF(LEFT(B1,1)="C","Hardware","")))
该公式由 3 个公式嵌套组成。
=IF(LEFT(B1,1)="A","Software","")
=IF(LEFT(B1,1)="B","Service","")
=IF(LEFT(B1,1)="C","Hardware","")