具有多个查询的 Excel 查找

发布于 2024-11-29 23:39:18 字数 608 浏览 0 评论 0原文

我有一个问题,我可能没有正确思考。但我有一个很长的 Excel 文件,我从其他地方提取了以下几列:

Project_Name1、Employee_Name1、Date_Worked1、Hours_Worked1

在另一张表中,我有这些列

Project_Name2、Employee_Name2、Begin_Date2、End_Date2、Hours_Worked2

第二张表填充了数据,并且工作得很好。 然而,事实证明我有一些我不知道名字的员工也在从事同一个项目。我需要找出员工的姓名,然后将他们在给定时间段内的工作小时数相加。 因此,我需要使用三个条件进行查找:

Project_Name1 = Project_Name2

Employee_Name1 <> {Employee_Name2 数组}

Begin_Date2 <= Date_Worked1 > End_Date2

返回员工姓名。

一旦我有了员工姓名,我就可以执行 sumifs=() 并获得他们的总工作时间,没有问题。

我已经尝试了多种索引匹配功能的组合,使用 ctrl-shift-enter... 但无法弄清楚它。任何帮助将不胜感激。

I have a question that I a may not be thinking correctly about. But I have an a long excel file that I pull from somewhere else with the following columns:

Project_Name1, Employee_Name1, Date_Worked1, Hours_Worked1

In another sheet I have these columns

Project_Name2, Employee_Name2, Begin_Date2, End_Date2, Hours_Worked2

This second sheet is filled with data, and works just fine.
However, it turns out that I have some employee names that I do not know that are also working on the same project. I need to figure out the names of the employees and then sum the number of hours they worked for a given period.
So I need a lookup with three criteria:

Project_Name1 = Project_Name2

Employee_Name1 <> {Array of Employee_Name2}

Begin_Date2 <= Date_Worked1 > End_Date2

Returning Employee name.

Once I have the employee name, I can do a sumifs=() and get the total hours they worked no problem.

I have tried a number of combinations of Index Match functions, using ctrl-shift-enter... and have not been able to figure out it. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

壹場煙雨 2024-12-06 23:39:18

您所说的操作非常复杂,并且有点超出了 Excel 默认设计的功能。但是,您可以使用一些解决方法来尝试获取您正在查找的信息。

  1. 可以通过连接字段来创建多部分标识符来执行多条件 VLOOKUP 和 SUMIF(例如:插入新列并在其中包含一个论坛,如 =A1&B1)
  2. 打开一个新工作簿并使用 Microsoft Query (I'我不确定您是否可以从多个工作表中进行选择,但是如果您可以从多个工作表(例如表格)中进行选择,您应该能够编写一个半复杂的查询来提取所需的数据集。
    http:// /office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
  3. 使用嵌入式宏功能并使用 Visual Basic脚本来写出您的业务逻辑。 (热键为 ALT+F11)

What you're talking about doing is extremely complicated and a little bit past what Excel was designed to do by default. However, there are a few workarounds that you can use to attempt to get the information that you're looking for.

  1. It's possible to do multiple-criteria VLOOKUPs and SUMIFs by concatenating fields to make a multi-part identifier (Ex: Insert a new column and have a forumla in it like =A1&B1)
  2. Open a new workbook and use Microsoft Query (I'm not sure if you can select from more than one sheet, but if you can select from multiple sheets like tables you should be able to write a semi-complex query to pull the dataset you want.
    http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
  3. Use the embedded macro feature and use visual basic script to write out your business logic. (Hotkey is ALT+F11)
傻比既视感 2024-12-06 23:39:18

一种方法是首先在您尝试从中提取员工姓名的工作表条目右侧创建一个附加列:=ROW()

然后您可以使用像您这样的数组公式正在尝试实现拉取相应的“匹配”行:

{=SUM((project_name1=projectname2)*(employeename1<>employeename2)*(begindate<=date_worked1)*(date_worked1>end_date2)*(match_column))}

然后您可以使用此返回的 match_column正如您所描述的那样,在索引中输入条目以检索适当的条目。

One way to do this would be to first create an additional column to the right of entries on the sheet you're trying to pull employee_name from: =ROW()

You could then use an array formula like you were trying to implement to pull the corresponding 'match' row:

{=SUM((project_name1=projectname2)*(employeename1<>employeename2)*(begindate<=date_worked1)*(date_worked1>end_date2)*(match_column))}

You could then use this returned match_column entry within the index as you described to retrieve the appropriate entries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文