How about something like this:
suppressPackageStartupMessages(library(tidyverse))
original_blue_chips <- tibble("Title" = c('Mickey Mantle', 'Mickey Mantle', 'Mickey Mantle', 'Mickey Mantle', 'Joe Namath', 'Joe Namath', 'Joe Namath', 'Joe Namath'),
"Sale_date" = c("2009-08-12", "2010-09-15","2011-10-12", "2012-09-01", "2009-08-12","2010-09-15","2011-10-12", "2012-09-01"),
"Price" = c(124, 156, 533, 174, 234, 299, 495, 485)) %>%
mutate(Sale_date = as.Date(Sale_date))
what_i_want <- tibble("Title" = c('Mickey Mantle', 'Mickey Mantle', 'Mickey Mantle', 'Mickey Mantle', 'Joe Namath', 'Joe Namath', 'Joe Namath', 'Joe Namath'),
"Sale_date" = c("2009-08-12", "2010-09-15","2011-10-12", "2012-09-01", "2009-08-12","2010-09-15","2011-10-12", "2012-09-01"),
"Price" = c(124, 156, 533, 174, 234, 299, 495, 485),
"Market_Value" = c(288, 288, 288, 288, 426, 426, 426, 426)) %>%
mutate(Sale_date = as.Date(Sale_date))
original_blue_chips
#> # A tibble: 8 x 3
#> Title Sale_date Price
#> <chr> <date> <dbl>
#> 1 Mickey Mantle 2009-08-12 124
#> 2 Mickey Mantle 2010-09-15 156
#> 3 Mickey Mantle 2011-10-12 533
#> 4 Mickey Mantle 2012-09-01 174
#> 5 Joe Namath 2009-08-12 234
#> 6 Joe Namath 2010-09-15 299
#> 7 Joe Namath 2011-10-12 495
#> 8 Joe Namath 2012-09-01 485
what_i_want
#> # A tibble: 8 x 4
#> Title Sale_date Price Market_Value
#> <chr> <date> <dbl> <dbl>
#> 1 Mickey Mantle 2009-08-12 124 288
#> 2 Mickey Mantle 2010-09-15 156 288
#> 3 Mickey Mantle 2011-10-12 533 288
#> 4 Mickey Mantle 2012-09-01 174 288
#> 5 Joe Namath 2009-08-12 234 426
#> 6 Joe Namath 2010-09-15 299 426
#> 7 Joe Namath 2011-10-12 495 426
#> 8 Joe Namath 2012-09-01 485 426
output <- original_blue_chips %>%
group_by(Title) %>%
mutate(order = rank(Sale_date),
is_last_3 = order > (max(order) - 2.5),
Market_Value = mean(if_else(is_last_3 == TRUE, Price, NA_real_), na.rm = TRUE))
output
#> # A tibble: 8 x 6
#> # Groups: Title [2]
#> Title Sale_date Price order is_last_3 Market_Value
#> <chr> <date> <dbl> <dbl> <lgl> <dbl>
#> 1 Mickey Mantle 2009-08-12 124 1 FALSE 288.
#> 2 Mickey Mantle 2010-09-15 156 2 TRUE 288.
#> 3 Mickey Mantle 2011-10-12 533 3 TRUE 288.
#> 4 Mickey Mantle 2012-09-01 174 4 TRUE 288.
#> 5 Joe Namath 2009-08-12 234 1 FALSE 426.
#> 6 Joe Namath 2010-09-15 299 2 TRUE 426.
#> 7 Joe Namath 2011-10-12 495 3 TRUE 426.
#> 8 Joe Namath 2012-09-01 485 4 TRUE 426.
Created on 2019-08-14 by the reprex package (v0.3.0)
If you feel like it, you can also drop the no-longer-necessary columns with output %>% select(-order, -is_last_3)