[英]Can Excel Lookup data for a record based on a unique key where there are multiple matches, but return only 1 record based on a condition?
If I have a sheet with the following data, where the constants are always going to be the Load number and the Key...如果我有一张包含以下数据的表格,其中的常量总是加载号和密钥...
Load![]() |
Key![]() |
Size![]() |
Color![]() |
Type![]() |
---|---|---|---|---|
1 ![]() |
Tom![]() |
XL![]() |
||
1 ![]() |
Jan![]() |
S![]() |
||
2 ![]() |
Tom![]() |
XL![]() |
Blue![]() |
|
2 ![]() |
Jan![]() |
S![]() |
Green![]() |
|
3 ![]() |
Tom![]() |
XL![]() |
Red![]() |
Pants![]() |
3 ![]() |
Jan![]() |
S![]() |
Green![]() |
Short![]() |
...is it possible, to have Excel lookup the key, and only bring back the size, color and type for the max(load) or highest load number? ...是否有可能让 Excel 查找密钥,并且只带回最大(负载)或最高负载数的大小、颜色和类型? So that it only shows the following?
所以它只显示以下内容?
Key![]() |
Size![]() |
Color![]() |
Type![]() |
---|---|---|---|
Tom![]() |
XL![]() |
Red![]() |
Pants![]() |
Jan![]() |
S![]() |
Green![]() |
Short![]() |
The short answer is Yes, that can be done.简短的回答是肯定的,这是可以做到的。 The following formula is one way to approach it:
以下公式是处理它的一种方法:
{=INDEX($E$1:$E$7,MATCH(A10&B10&C10,$B$1:$B$7&$C$1:$C$7&$D$1:$D$7,0))}
Notes:笔记:
a) The above is how the formula would look in cell D10, assuming the tables are as shown in the image below. a) 以上是公式在单元格 D10 中的样子,假设表格如下图所示。
b) This is an array formula and you don't enter the opening { or closing }. b) 这是一个数组公式,您不输入开始 { 或结束 }。 Rather, you 'commit' the formula using Ctrl, Shift and Enter.
相反,您使用 Ctrl、Shift 和 Enter 来“提交”公式。
If I understood it right you want all the itens where load is 3 or max(Load), doesn't matter other parameters.如果我理解正确,您想要所有负载为 3 或最大(负载)的项目,其他参数无关紧要。 My answer suppose you have Excel 365, you only need to place it once in cell H2 of the exemple.
我的回答假设您有 Excel 365,您只需在示例的单元格 H2 中放置一次。
=FILTER(Table[[Key]:[Type]];Table[Load]=MAX(Table[Load]);NA())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.