Excel formula to UDF

rehanemis

Board Regular
Joined
Aug 15, 2016
Messages
50
HI,
I am using these formula's to calculate the Grade and Commission as Category/Grade and Commission is also mentioned. I am using these functions and working well. Now I would like to convert my function to UDF so that I can only choose Ach and Ach% and get the Grade and Commission.
Like =GetGrade(B3,C3) and it return grade and same for commission.
I also want a tool tip if possible when entering formula like =GetGrade(Choose Ach, Choose Ach%).

Thanks
excel pic.JPG
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You can post an extract of your sheet with the forum's tool named XL2BB.

You could consider Excel's Lambda functionality instead of a UDF.
I named the Lambda GetGrade.

The function will indicate the parameters in my example like =GetGrade(Ach,AchP)

LAMBDA(Ach,AchP,LET(a,Ach,p,AchP,IF(AND(a>=50,p>=0.95),"A",IF(AND(a>=25,p>=0.95),"B","C"))))

LAMBDA.xlsm
ABCDE
1
2
38999%AA
43599%BB
53090%CC
6
4a
Cell Formulas
RangeFormula
D3:D5D3=IF(AND(B3>=50,C3>=0.95),"A",IF(AND(B3>=25,C3>=0.95),"B","C"))
E3:E5E3=GetGrade(B3,C3)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top