両方の条件が合致した場合。IF関数だけじゃ面倒です。IF+AND関数
https://infoyandssblog.blogspot.com/2014/03/excelififand.html
どっちかの条件が合致した場合。IF関数だけじゃ面倒です。IF+OR関数
https://infoyandssblog.blogspot.com/2014/03/excelififor.html