With base R
aggregate(Total ~ Participant, df[df$Round %in% c(100, 200), ], diff)
Or similarly in combination with subset
aggregate(Total ~ Participant, df, subset = Round %in% c(100, 200), diff)
Or using data.table
library(data.table) ; setDT(df)[Round %in% c(100, 200), diff(Total), by = Participant]
Or using a binary connection
setkey(setDT(df), Round) df[.(c(100, 200)), diff(Total), by = Participant]
Or using dplyr
library(dplyr) df %>% group_by(Participant) %>% filter(Round %in% c(100, 200)) %>% summarise(Total = diff(Total))
source share