Reputation: 4359
Consider the following spreadsheet snippet:
I'm trying to write the following forumla:
For a give row, for the same Sales#:
If Type=1 OR Type=2, go the first non-zero previous cell in the column
and copy the lineprice
I know how to examine the type field:
=IF((OR(VALUE(BA7)=1,VALUE(BA7)=2)), ?????, "")
I'm not sure how to retrieve the lineprice. I would like to do this via a formula if possible.
Thanks
Upvotes: 0
Views: 88
Reputation: 152505
=IF(OR(C7={1,2}),INDEX($B$1:$B6,AGGREGATE(14,7,ROW($B$2:$B6)/(($A$2:$A$6=A7)*($B$2:$B6<>0)),1)),0)
Upvotes: 1