简体   繁体   English

Excel 动态数组溢出区域 - 它可以沿着一行还是沿着一列?

[英]Excel Dynamic Array Spill Area - can it go along a row or just down a column?

The point of this exercise is to try to make this analysis quicker/easier to update.此练习的目的是尝试使此分析更快/更易于更新。 I had it pretty dialed in using a data tab and a pivot table, copying and pasting values/formulas as needed to update.我使用数据选项卡和数据透视表,根据需要复制和粘贴值/公式以进行更新。 I am trying to improve on that by using Excel's new Dynamic Arrays.我正在尝试通过使用 Excel 的新动态数组来改进它。

My table is setup with four employee detail columns (Location Name, Location Number, Employee Name, Employee Number), and several (many) columns for dates worked.我的表设置了四个员工详细信息列(位置名称、位置编号、员工姓名、员工编号)和几个(许多)工作日期列。 My issue is the dates worked .我的问题是工作日期

I am using UNIQUE and FILTER to get a list of flagged employees - works as I intended/hoped;我正在使用 UNIQUE 和 FILTER 来获取被标记员工的列表 - 按我的意图/希望工作; lookup formulas to find the location name and number data for each employee from the data table - works as I intended/hoped;查找公式以从数据表中查找每个员工的位置名称和编号数据 - 按我的意图/希望工作; and I have been copying/pasting the dates from the pivot table column headers into my "counting"/analysis table header.我一直在将数据透视表列标题中的日期复制/粘贴到我的“计数”/分析表标题中。

What I would like to do is use the UNIQUE formula to get the dates worked - BUT, I want the spill area to go along the row so the dates are column headers.我想要做的是使用 UNIQUE 公式来获得有效的日期 - 但是,我希望溢出区域沿着行走,因此日期是列标题。 Okay, I probably could have made that a shorter ask, but I hope explaining a little of what I'm trying to do helps.好的,我可能可以提出一个更短的问题,但我希望解释一些我正在尝试做的事情会有所帮助。 I want the dates to automatically update when I paste new payroll/hours worked data into the data table, the same way the employee data updates.当我将新的工资单/工时数据粘贴到数据表中时,我希望日期自动更新,与员工数据更新的方式相同。

The key is to TRANSPOSE the UNIQUE formula, not the data:关键是要转置 UNIQUE 公式,而不是数据:

=TRANSPOSE(UNIQUE(A1:A9))

在此处输入图片说明

I cannot find anything about having the spill area go along a row instead of down a column.我找不到任何关于让溢出区域沿着一行而不是沿着列排列的任何信息。 My workaround for this was to create a column of unique dates next to my data table.我的解决方法是在我的数据表旁边创建一列唯一日期。 Since the data is in a table, the unique dates will update automatically when the table is updated.由于数据在表中,当表更新时,唯一日期将自动更新。 I used the Offset formula to pull the dates into my column headers from the column of Unique dates next to my data table.我使用偏移公式将日期从数据表旁边的唯一日期列中提取到列标题中。 I will say, while this setup is easier than updating via the pivot table, it is a formula heavy workbook now.我会说,虽然这个设置比通过数据透视表更新更容易,但它现在是一个公式繁重的工作簿。

For the data headers I used : "=OFFSET('Data Table Tab'!$U1,Column()-5,0)".对于我使用的数据标题:“=OFFSET('Data Table Tab'!$U1,Column()-5,0)”。 The "rows to offset" portion of the formula is "Column()-5".公式的“要偏移的行”部分是“Column()-5”。 My first date header is in column 5, so as it is copied to the right this will increment the number of rows to offset from the first date.我的第一个日期标题在第 5 列中,因此当它被复制到右侧时,这将增加从第一个日期偏移的行数。

At this point I will just need to copy the formulas over to the right to update my analysis table.此时,我只需要将公式复制到右侧即可更新我的分析表。

I would be surprised if someone else out there just starting to work with the new Dynamic Array formulas in Excel doesn't wonder about the same thing.如果刚开始在 Excel 中使用新动态数组公式的其他人不怀疑同样的事情,我会感到惊讶。 If you stumble across this question and have a better solution, please feel free to share it with me.如果您偶然发现了这个问题并有更好的解决方案,请随时与我分享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM