简体   繁体   English

Excel 基于先前匹配标准的公式计算

[英]Excel Formula calculation based on pervious matching criteria

在此处输入图像描述

Column A contains reference value Column B is a data unique to that Row Column C is where I need a formula to pull a prior Row's Column B data if the Reference Column A has a "Y" in it. A 列包含参考值 B 列是该行独有的数据 列 C 是如果参考列 A 中有“Y”,我需要一个公式来提取先前行的 B 列数据。 Note: Rows between "Y" in live data set can range between 3 and 5 is what the output would need to look like as above picture注意:实时数据集中“Y”之间的行可以介于 3 和 5 之间,这就是 output 需要的样子,如上图所示

If you have Excel O365, you can use:如果你有 Excel O365,你可以使用:

在此处输入图像描述

Formula in C2 : C2中的公式:

=IF(A2="Y",XLOOKUP("Y",A$1:A1,B$1:B1,"",0,-1),"")

In earlier versions of Excel, try:在 Excel 的早期版本中,尝试:

=IFERROR(LOOKUP(2,1/((A$1:A1="Y")*(A2="Y")),B$1:B1),"")

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

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