1. Create a UDF (User Defined Function)
Use the If Then statement in Excel VBA code lines function to act if a specific condition is met. To create this Function, execute the following steps
This Will Create A new UDF (User Defined Function) with name grade(S),we Can use this As we Required. type in Excel the function = grade(A1) ,the UDF Comes up in small letter’s to differentiate itself from Standard Excel Formula
This Code lines will create function grade ()
In Cell B1 Type
= grade(A1)
2. Use Excel Formulas (IF) Syntax
IF(logical_test, value_if_true, [value_if_false])
=IF(B1>79,"Excellent",IF(B1>49,"Good",IF(B1>19,"Average",IF(B1>1,"Worst","N/a"))))