You don't need a macro for this. In cell I2:
=VLOOKUP(TODAY()-MAXIFS($H$2:$H$1935,$B$2:$B$1935,B2),{-1,"0-30";30,"30-60";60,"60-90";90,"90-365";365,">365"},2,1)
copied down.
I've put this formula in column P of the attached.
You might want to tweak it a bit to get the thresholds exactly as you want them, so there's a test-bed at cell T2, referring to a lookup table at cell W2 which also serves to show how the formula was derived. Adjust the thresholds in column W to get the results you want to see in column U. When satisfied, you can do away with the lookup table by using this formula in P2/I2:
=VLOOKUP(TODAY()-MAXIFS($H$2:$H$1935,$B$2:$B$1935,B2),$W$2:$X$6,2,1)
then editing the formula, selecting only the $W$2:$X$6 bit and pressing F9 on the keyboard,
this will produce the likes of:=VLOOKUP(TODAY()-MAXIFS($H$2:$H$1935,$B$2:$B$1935,B2),{-1,"0-30";30,"30-60";60,"60-90";90,"90-365";365,">365"},2,1),
then pressing Enter. Then you can copy down, and delete the lookup table.
Oops, I've just noticed you want the oldest date kept, so change MAXIFS to MINIFS.