Can someone help in rewriting this Excel formula in R Studio?

You can use dplyr::case_when()

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.