简体   繁体   English

如何在excel列中获取下一个非空单元格值

[英]how to get next non empty cell value in an excel column

Here is my excel looks 这是我的擅长外观

Column A        Column B
1/1/2016          
2/1/2016
3/1/2016
4/1/2016
5/1/2016
.
.
.
31/1/2016          1000

Now I will be referring one of the date in this month on another sheet and I would like to pull Column B value corresponding to last date on each month. 现在,我将在另一张纸上引用该月中的某个日期,我想提取与每个月的最后日期相对应的B列值。 There wont be any value till last date on column B. 直到最后日期B列上都没有任何值。

Any hint to do this ? 任何暗示这样做吗?

First step is to make the condition: 第一步是使病情:

=IF(A1=EOMONTH(A1,0),B1,"")

Note: if date in A1 is really the end of its month, it takes result from B1 注意:如果A1中的日期确实是该月的月底,则采用B1的结果

Second step is to combine it with Vlookup. 第二步是将它与VLOOKUP结合。 I assume that you would input some date in column C: 我假设您会在C列中输入一些日期:

=IF(C1=EOMONTH(A1,0),VLOOKUP(C1,$A$1:$B$1000,2,FALSE),"")

Third step is... you can change the formula if your input is in another sheet. 第三步是...如果输入内容在另一张纸上,则可以更改公式。 For the example: the data are in "sheet1" and the date input are in column C at "sheet2" : 例如: 数据在“ sheet1”中,日期输入在C列中“ sheet2”

=IF(C1=EOMONTH(Sheet1!A1,0),VLOOKUP(C1,Sheet1!$A$1:$B$1000,2,FALSE),"")

Hope it'll help. 希望能对您有所帮助。

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

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