简体   繁体   English

Excel 公式返回最新日期旁边的值

[英]Excel Formula return the value beside the latest date

I want to return the Card used to B2 based on the table to the right.我想根据右侧的表格将用于B2的卡归还。

This returned value should be of the latest date(column G), and the cell to the left of the date should not be blank.此返回值应为最新日期(G 列),日期左侧的单元格不应为空。 If it is blank, return the next latest value.如果为空,则返回下一个最新值。

I have this formula but I want it to return Bank B onto B3 instead of "0" how do i go about achieving this?我有这个公式,但我希望它将 B 银行返回到 B3 而不是“0”,我该如何实现这一目标?

   =INDEX($F$2:$F$7, MATCH(A2 & MAX(IF($E$2:$E$7=A2,$G$2:$G$7)), $E$2:$E$7 & 
  $G$2:$G$7, 0))

在此处输入图片说明

For this, you need a complex array formula:为此,您需要一个复杂的数组公式:

=INDEX($F$2:$F$7;MATCH(MAX(IF(IF($F$2:$F$7<>"";$E$2:$E$7)=A2;$G$2:$G$7))&A2;$G$2:$G$7&$E$2:$E$7;0);1)

IMPORTANT!: Because it is an array formula, you will need to type it as usual, and then, instead of pressing Enter press CTRL + SHIFT + ENTER重要!:因为它是一个数组公式,则需要将其键入像往常一样,然后,代替按Enter键按下CTRL + Shift + Enter

I've tested in my Excel and got this:我已经在我的 Excel 中进行了测试并得到了这个:

在此处输入图片说明

Try INDEX/AGGREGATE with a nested AGGREGATE for the conditional MAXIFS (assuming you don't have MAXIFS).为条件 MAXIFS 尝试使用嵌套 AGGREGATE 的 INDEX/AGGREGATE(假设您没有 MAXIFS)。

在此处输入图片说明

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

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