#### fitzchivalry

##### New Member

- Joined
- Mar 23, 2015

- Messages
- 33

I have a spreadsheet with Sales Transaction Data on one sheet:

with dates in A (TransDate),

product identifiers in G (TransProduct),

transaction amounts in K (TransConfirmedtransactions),

and Product Stats on another sheet:

with Product Identifiers in A

and the formula going in E2 for example.

In E2 on the Product Stats page I'd like to display the date of the most recent negative transaction.

So:

Looking for Product Identifier; found in $A2 on the sheet the formula is being entered on.

Looking for this in range TransProduct.

Then checking if the amount for the corresponding transaction is positive, and if so, moving on to the next most recent match until a negative is found.

Then displaying the date of this in the cell.

I have no idea if this is actually possible, but it seems Excel can do just about anything...

-\/- My efforts at solving this, unfruitful so far -\/-

I have an array formula (that I found on this forum I'm pretty sure) {=MAX(IF(TransProduct=$A2,TransDate,""))} so am using that as a starting point.

And I've seen =COUNTIF($A$1:$A$8,"<0") (here http://www.mrexcel.com/forum/excel-questions/31251-count-negative-cells-count-positive-cells.html) which counts negative amounts, and I take from that "<0" will probably be part of the answer.

MAX IFs:

I was reading on another about creating a MAX formula with multiple IFs. This sounds like what I need.

I've tried

{=MAX(IF(TransCust=$A2,IF(TransConfirmedTrans=<0,TransDate,"")))}

I get corrected by Excel when I do that, so I've counted all the various brackets here:

{=MAX

(IF

(TransCust=$A2,

IF(TransConfirmedTrans<=0,TransDate,""

)

)

)

}

Now I'm stumped, am still working on this but maybe someone can tell me if I'm on the right track?