Formula on a column given a moving condition in another column

Formula on a column given a moving condition in another column

I have table with three rows, invoice#, customer#, date.
I am trying to get a formula that counts the max date where the customer # in the row occured in the list.
and another formula to tell me if this is the first occurance of this customer# or not

been going in circles forever, hope someone can help.

Thanks