I think my image will probably convey 90% of the problem. My try is what I have posted below: (Separate only last occurrence of / when ColB contains "Sep")
df <- structure(list(ColA = c("abc/def", "bcd/efg", "def/ghj/yes",
"fet/hjk/yes"), ColB = c("sep", "no", "sep", "no")), class = "data.frame", row.names = c(NA,
-4L))
library(tidyverse)
df %>%
mutate(across(str_detect(ColB,"sep")~separate(ColA,into=c("A1","A2"),sep="/",
TRUE ~ NA))
