由于我对 Excel 非常缺乏经验,因此我在以下情况下苦苦挣扎。
在一张表中,我有以下列
Account Investment
1 a
2 b
3 c
1 d
2 e
1 a
我想要的输出,在不同的工作表中,应该是这样的
AccountAc InvestmentAc
1 a
d
2 b
e
3 c
我有 AccountAc 的这个公式=IFERROR(IF(InvInformation[Account]=$A2, "", INDEX(InvInformation[Account], MATCH(0, FREQUENCY(IF(EXACT(InvInformation[Account], TRANSPOSE($A$2:$A2)), MATCH(ROW(InvInformation[Account]), ROW(InvInformation[Account])), ""), MATCH(ROW(InvInformation[Account]), ROW(InvInformation[Account]))), 0))), "")
而在 InvestmentAc 中=IFERROR((INDEX(InvInformation[Investment], MATCH(2, (COUNTIF($B$2:$B2, InvInformation[Investment])+(InvInformation[Account]=[@AccountAc]))+(COUNTIF($B$2:$B2, InvInformation[Investment])+(InvInformation[Actual]=1)), 0), COLUMN(A1))), "")
(InvInformation 是能够包含 Account 和 Investment 的)
返回此结果
AccountAc InvestmentAc
1 a
2 b
3 c
我知道为什么 InvestmentAc 的值“d”被跳过(因为它指出 @AccountAc 是空的)
注意:结果表必须是动态的。当更多数据添加到账户和投资时,结果表也会扩展。
有人知道我如何获得所需的结果并指向 InvestmentAc 中的非空白单元格吗?所有这些都必须在没有 VBA 的情况下完成,只有公式。