问题描述
经理员工表
A B
1 manager Employee
2 M1 E1
3 M1 E2
4 M1 E44
5 M1 E41
6 M1 E34
7 M2 E100
8 M2 E17
9 M2 E29 and so on
我正在制作一个动态仪表板,其中我需要动态反映每个经理下的员工.
I am making a dynamic dashboard where I need the employees under each manager to be dynamically reflected.
仪表板
A B
1 Input Manager M1 #basically user inputs one manager name here in this cell
2 E1
3 E2
4 E44
5 E41
6 E34
因此,当我在 DashboardSheet
的 B1 单元格中输入 M1 经理时,我应该在下面的单元格中将所有员工置于他之下,同样,如果我输入任何其他经理,我应该将所有员工置于该经理之下.单独 Vlookup 只会返回与 manager 对应的第一个员工,但我需要他下面的所有员工.
So when I input M1 manager in cell B1 of DashboardSheet
, I should get all employees under him in below cells, similarly if I input any other manager , I should get all employees under that manager. Vlookup alone will return only the first employee corresponding to the manager, but i need all employees under him.
我已经读到,vlookup
和 offset
可能可以做到这一点.但我不确定.
I have read that maybe vlookup
with offset
can do this. But I am not sure.
有人可以帮忙吗?
推荐答案
如果您有 Office365
,那么您可以使用 Filter
公式轻松实现.根据屏幕截图尝试以下公式.
If you have Office365
then you can easily do that with Filter
formula. Try below formula as per screenshot.
=FILTER(B2:B9,A2:A9=E1)
如果您没有 Office365
,请一起使用 INDEX()
和 AGGREGATE()
公式.根据我的屏幕截图,使用下面的公式到 D2
单元格.
If you do not have Office365
then use INDEX()
and AGGREGATE()
formula together. As per my screenshot use below formula to D2
cell.
=IFERROR(INDEX($B$2:$B$9,AGGREGATE(15,6,ROW($1:$9)/($A$2:$A$9=$E$1),ROW(1:1))),"")
这篇关于Vlookup 的值数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!