I have a spreadsheet with several columns of data. I have a formula that returns a cell from column "a" if column "d" contains a "Y". It returns the next cell in the column where that criteria is found. I want to modify the formula so that it does the same thing if the cell in column d is blank.

This is the formula I use to get the data from column a =IF(ROWS(P$3:P3)<=$P$2,INDEX(A$2:A$133,SMALL(IF($D$2:$D$133=$O$2,ROW($D$2:$D$133)-ROW($A$2)+1),ROWS(P$3:P3))),""). I have tried to modify the formula so that the small looks at a 02 and returns the data if it is a blank. I have tried to insert a match formula that returns the row reference for a blank cell. I am stuck!