Dear Mentors/Friends
Hope You are doing good
Though i have watched so many videos and gone though several post to create formula to excel udf ( User Defined Function) that i can use it easily however i am not sure how to prepare it.

Here is the formula

E2 =IF(COUNTIF(A22,"Yes"),"Rule"&SUBSTITUTE(TRIM(IF(A2="Yes","1 ","")&IF(B2="Yes","2 ","")&IF(C2="Yes","3 ","")&IF(D2="Yes","4",""))," ",","),"")



Also is it possible to select the ranges though input box
Just started learning excel and vba not very much sure how to do it .

Thanks for you efforts