简体   繁体   English

如何在Excel中查找最大值并返回相邻单元格

[英]How to find max and return adjacent cell in Excel

Imagine a table: 想象一张桌子:

Red 8 Black 1    
Red 2 Black 3    
Red 1 Black 0    
Red 7 Black 8    
Red 4 Black 5

How do I return "Red" or "Black" in a third column for each row depending on which has a larger value? 如何根据每行的较大值在第三列中返回“红色”或“黑色”?

It would be: 这将是:

Red 8 Black 1 Red    
Red 2 Black 3 Black    
Red 1 Black 0 Red    
Red 7 Black 8 Black    
Red 4 Black 5 Black

Use: 采用:

=INDEX(A2:D2,MATCH(MAX(A2:D2),A2:D2,0)-1)

在此处输入图片说明


Edit: 编辑:

Since there are only two Options, a simple IF will work: 由于只有两个选项,因此可以使用一个简单的IF:

=IF(B2>D2,A2,C2)

在此处输入图片说明

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

相关问题 从多个列中查找最大值并从相邻列中返回单元格值-Excel - Find max value from multiple columns and return cell value from adjacent column - Excel 查找一行中最高的单元格值并在Excel中返回相邻的单元格值 - Find the highest cell value in a row and return the adjacent cell value in Excel 在Excel中查找最高值并返回重复的相邻单元格值 - Find The Highest Value And Return Adjacent Cell Value with duplicates In Excel 如何在Excel中找到最大值并返回两个第一个相邻的单元格值? - How To Find The Highest Value And Return The Two First Adjacent Cell Value In Excel? 如何在其中一个不相邻的列中找到一个单元格并返回行号 - Excel 需要公式 - How to find a cell in one of thee non-adjacent columns and return the row number - Excel Formula needed 如何查找与当前单元格相邻的单元格的值C#+ Excel - How to find the value of a cell adjacent to the current cell C# + Excel 在Excel中的相邻单元格中查找值 - Find value in adjacent cell in excel 如何在 Excel 中查找动态单元格的最大值和最小值 - How to find max and min of a dyanamic cell in Excel 如何在Excel上随机选择单元格和相邻单元格 - How to randomly select cell and the adjacent cell on excel 如何连续选择与最大数目相邻的单元格 - How to Choose Cell Adjacent to the Max Number in a Row
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM