+ Start a Discussion
Christina Lam 7Christina Lam 7 

Formulas with Different Data Types

Hello! Is it possible to use two data types in a formula? For instance, using a "text" field in a formula for a "number" field.

Thanks!
Abdul KhatriAbdul Khatri
Please share more details what you wanted to accomplish.
Raj VakatiRaj Vakati
You cannt convert the Text to Number types in formula ..

If you wnated to do it .. you need to use the code 
Alain CabonAlain Cabon
VALUE Description:  Converts a text string to a number.
Use:VALUE(text) and replace text with the field or expression you want converted into a number.
Example:Lead Number
VALUE(Lead_Number__c) returns a number for the text value in the auto-number field Lead Number. 
https://help.salesforce.com/articleView?id=customize_functions_i_z.htm&type=5
Christina Lam 7Christina Lam 7
Thanks all! So, an example of this issue: there are two fields: 1) homeownership rate (percent field type) and 2) score (number field type). In order to convert field 1 to field 2 (ie: if 60%, then 2, or 80%, then 3, etc.), the formula will only work if homeownership rate changes from percent to number. It would be great to keep the homeownership rate percent field type and then use a formula in field 2 that reflects field 1 as a number type.