Home » excel » excel – Using an if statement with indexing

excel – Using an if statement with indexing

Posted by: admin May 14, 2020 Leave a comment

Questions:

Sorry for my incompetence here.. but I’m trying to get the next date in succession based on the previous row. If cell d2 is blank return the date in b2. If cell d2 is not blank return the date in b3.

This is an index/match formula but don’t know if you could put in a condition for the index formula.

I created a very basic if statement that captures this, but I need the cell to constantly be updated with the newest date based off the d column.

=If(d2=””,B2,B3)

Code worked but only for the first referenced cell. I need the date to update if I edit cell d3, d4, …etc.

enter image description here

How to&Answers:

Another way to put it would be “I want to return the value in column B that corresponds to the first blank cell in column D

Assuming there are no skipped rows, this should work:

=INDEX(B:B,COUNTA(D:D)+1)