Use If Condition.
Please attach a worksheet with sample data and expected Result.