looking age of last non-matching value

I have data that looks like this (three columns: Date, IGN and AP):

 

Date IGN AP
8/8/2019 Emxmari0 3560
8/11/2019 Emxmari0 3580
8/12/2019 Emxmari0 3580
8/16/2019 Emxmari0 3590
8/17/2019 Emxmari0 3590
8/21/2019 Emxmari0 3590
8/22/2019 Emxmari0 3590
8/23/2019 Emxmari0 3590
8/24/2019 Emxmari0 3590
8/28/2019 Emxmari0 3590
8/31/2019 Emxmari0 3590

 

I would like to create a new column AGE that when looking up the last value for the IGN column (just showing Emxmari0 in this case) I would like to look up the AP (3590) for last row of the given IGN (the 8/31/2019 date) and then look backwards in time to find the row for the given IGN with a different value in the AP column (the 8/12/2019 date vas a value of 3580), then with the two rows identified give the difference in days using the A column, 19 in this case.  If a row for a given IGN isn’t the last row (which presumes the highest date) then the value for AGE would be blank.

Any help toward figuring this out would be appreciated!

By: Joel Breazeale

53 thoughts on “looking age of last non-matching value

  1. fitflop sale

    I’m usually to blogging and i really admire your content. The article has actually peaks my interest. I’m going to bookmark your website and maintain checking for new information.

Leave a Reply

Your email address will not be published. Required fields are marked *