用数据填充电子表格的公式
我想在给定的条件下填充一些单元格。问题是,我不知道如何仅使用公式来做到这一点(不能使用宏或排序)。
无论如何,这是我的工作簿,及其**工作表**:
**Sheet1**
TASK Week
Test 1
Test2 1
Test3 1
Test4 2
Test5 3
Test6 2
Test7
**Sheet2**
Week
2
TASK
Test4
Test6
我一直在尝试做的是:
- 根据所选的周填充 Sheet2 任务。
- 如果我选择第 2 周(在 Sheet2 中),它应该使用 Sheet1 中具有该周编号的任务填充任务列表(在同一张工作表上)。
例如,现在(假设)已经加载一周 == 2 的任务。
如有疑问,请告诉我!我希望我说清楚了我的问题。
预先非常感谢您!
I want to populate some cells given certain condition. The thing is, I have no idea how to do this with just formulas (can’t use macros or the sort).
Anyways, here’s my workbook, with its **sheets**:
**Sheet1**
TASK Week
Test 1
Test2 1
Test3 1
Test4 2
Test5 3
Test6 2
Test7
**Sheet2**
Week
2
TASK
Test4
Test6
What I’ve been trying to do is:
- Populate Sheet2 tasks based on the week chosen.
- If I choose week #2 (in Sheet2), it should populate the task list (on the same sheet) with the tasks from Sheet1 that have that week number.
For example, right now it is (hypothetically) already loading tasks with a week == 2.
Any doubt, just let me know! I hope I made my issue clear.
Thank you very much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我找到了更好的解决方案。这需要 Sheet2 上有一个额外的辅助列,但它至少返回一个紧凑的匹配列表(没有奇怪的间距)。
在 Sheet2 上,在匹配列表的第一行(本例中为 A3)中输入以下内容:
在下一列(此处为 B3)的相邻单元格中输入以下内容:
其中 2 是您要匹配的周数。
在下一行中输入以下公式(分别在 A4 和 B4 中):
并且
您可以根据需要填写此行公式。
Okay, I found a better solution. This one requires an extra helper column on Sheet2, but it at least returns a compact list of matches (no weird spacing).
On Sheet2, in the first row of your list of matches (A3 in this example) enter the following:
In the adjacent cell in the next column (B3 here) enter the following:
where 2 is the week # you are matching.
In the next row enter the following formulas (in A4 and B4 respectively):
and
You can fill down this row of formulas as far as you like.
这是我想到的第一种方法。可能有更好、更优雅的解决方案,但我想我会分享。
如果您知道 Sheet1 列表中的任务总数,例如 n,您可以执行以下操作:
在不更改选择的情况下,键入以下公式:
=IF(Sheet1!B2:B8=2,Sheet1!A2:A8,"")
其中 2 是您要匹配的第 # 周。
Here's the first way to do this I thought of. There are probably better, more elegant solutions, but I thought I'd share.
If you know the total number of tasks in your list on Sheet1, say n, you can do the following:
Without changing the selection, type the following formula:
=IF(Sheet1!B2:B8=2,Sheet1!A2:A8,"")
where 2 is the week # you want to match.