基于行 ID 的特定列 headers 的行数据

Row data for specific column headers based on row ID

我有一个工作sheet 有几百行员工数据。在最基本的层面上,它列出了 EmployeeIDName 并列出了 他们拥有的技能

我所做的是 另一 工作sheet(在我的 Employee Lookup 工作簿中)我有使用索引和匹配函数的组合来查找我输入的 EmployeeID 和 return 来自员工技能数据 sheet 的技能水平。

我想做的是尝试简化数据的获取方式(我的知识有限 vba 但有一些 excel 公式知识,因此嵌套索引匹配)。 Employee Skills sheet 有 Column AEmployeeID 以及 Row A 技能名称(以及之前的 headers)。

我可以为每一行设置 Index/Match 但是我需要为每个技能设置 列号 并查找 EmployeeID 和 return 技能(即使它们是 空白 )。

我不会真的费心去弄清楚如何开始编写这个代码,但我认为有比制作 Index/Match 公式更简单的方法对于每个参考技能(当我协助 4 个部门时,每个部门有 ~15-50 个技能)。

Index/Match 功能会花费很多时间,并且已经有一组。我不认为我想要的可以在 Excel 中完成,但不幸的是,这是我剩下的数据资源。

分布示例sheet布局:

简答:

(分解公式的详细和颜色编码的屏幕截图进一步向下,或全屏 .PNG here .)

这是一个使用与您类似的示例数据的解决方案:

D16中公式的"short version"为:

=INDEX($C:$I,MATCH($D,$A:$A,0),MATCH(C16,$C:$I,0))

我使用的 actual 公式看起来更可怕,但它只是上面的公式两次 (copy/pasted) 和一个 IF 所以它会带来如果 "source cell" 为空白(如 Jane 的派对得分),则为空白单元格...

=IF(INDEX($C:$I,MATCH($D,$A:$A,0),MATCH(C16,$C:$I,0))=0,"",INDEX($C:$I,MATCH($D,$A:$A,0),MATCH(C16,$C:$I,0)))

一旦那个公式在D16,我就"filled down"(或copy/paste)到其他技能。

  • 注意上面公式中的all单元格引用是“Absolute”[= C16 的 109=] 除了 。

我们希望 所有 单元格范围保持不变,即使我们 copy/paste(或填充)单元格到另一个cell... except for C16:这就是我们的查找 基于 所以一旦 does 需要当我们将单元格复制到别处时进行更改。


"Two-dimensional Index/Match" 示例:

Download .xslx sample file:

To get a better idea of how it works, you can download the Excel file from my screenshot here to experiment, modify, and adapt as desired.

It's a direct-download link to a Macro-free .XSLX, hosted by Jumpshare, which allows you to view online but it doesn't like complex formulae, and the columnar formatting is messed up on some browsers (however you can also download from the online viewer with the DOWNLOAD button at the ↗top-right↗ of the viewer.


INDEX & MATCH 函数文档及更多示例:


关于绝对与相对单元格引用的速成课程

单元格引用 — 单元格引用是指工作表上的一个单元格或单元格区域,可以在公式中使用,以便 Microsoft Office Excel找到您希望该公式计算的值或数据。 (Source)

By default, a cell reference is relative. For example, when you refer to cell A2 from cell C2, you are actually referring to a cell that is two columns to the left (C minus A), and in the same row (2). A formula that contains a relative cell reference changes as you copy it from one cell to another.

As an example, if you copy the formula =A2+B2 from cell C2 to D2, the formula in D2 adjusts to the right by one column and becomes =B2+C2. If you want to maintain the original cell reference in this example when you copy it, you make the cell reference absolute by preceding the columns (A and B) and row (2) with a dollar sign ($). Then, when you copy the formula =$A+$B from C2 to D2, the formula stays exactly the same.

In less frequent cases, you may want to make a cell reference "mixed" by preceding either the column or the row value with a dollar sign to "lock" either the column or the row (for example, $A2 or B).

(Source)


>

"Regional Afterthought":

While answering a question about , I wondered if $ is the international symbol for Absolute References, or whether the symbol varied "across the pond".

("Will Brexit change "U.K. Absolutes" from =€A€1 to =£A£1?!")

快速搜索显示 $ 确实是用于 Excel 绝对值的 "worldwide" 符号——但是一些用户(之前从未输入过 $)麻烦定位它。这是一个 link 描述 How to type the $ Dollar Sign on Non-American Keyboards...


祝您项目顺利!如果您有任何问题,请告诉我...