function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
devSTdevST 

ISBLANK help in formula

I'm trying to return certain values if customer enters a number.  If the customer doesn't enter a number, I don't want to display anything (leave as blank). 
I have the formula set to 'treat blanks as blanks' but I get the following error for below formula:
  INCORRECT PARAMETER TYPE FOR FUNCTION 'iF(). Expected Text, Received Number.    Any suggestions/workarounds would be greatly appreciated.

My formula is:
IF (ISBLANK(NPS_Rating__c), "",
IF (NPS_Rating__c = 10, 1,
IF (NPS_Rating__c = 9, 1,
IF (NPS_Rating__c = 8, 0,
IF (NPS_Rating__c = 7, 0, -1
)
)
)
)
)
Best Answer chosen by devST
KaranrajKaranraj
Try the below formula and I believe NPS_Rating is a number field and your formula field return type also number
CASE(NPS_Rating__c,
10,1, 
9, 1, 
8, 0, 
7, 0,
NULL)

All Answers

KaranrajKaranraj
Try the below formula and I believe NPS_Rating is a number field and your formula field return type also number
CASE(NPS_Rating__c,
10,1, 
9, 1, 
8, 0, 
7, 0,
NULL)
This was selected as the best answer
devSTdevST
Thanks Karanraj! 
Yes, NPS_Rating is a number field.  Worked perfectly.