+ Start a Discussion
SS_SFSS_SF 

How to convert text to number in fomula field

Please help me ,

 I create new formula field ( Data type is Number ) for calculate value from text field but system not allow me to calculate it. Do you have any suggest me ?

 

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

Use the VALUE function

 

VALUE(text)
Converts a text string that represents a number to a number

All Answers

Ritesh AswaneyRitesh Aswaney

Use the VALUE function

 

VALUE(text)
Converts a text string that represents a number to a number
This was selected as the best answer
SS_SFSS_SF

It work! now , Thank

Onttu Lindeman 12Onttu Lindeman 12
I tried that with 09:12 and it just errored out.
Kevin Hart 3Kevin Hart 3
That's because 09:12 isn't a number, it's a time...  use datetime if you have dates too or text with validation rules if you only have hours/minutes. You can also convert time to minutes in a day and validate that way - split the string at the colon and take hours * 60 + minutes and convert to a number.
Carlo Cruz 3Carlo Cruz 3

Hi Ritesh & Kevin - I created a formula field to convert a formula text field (that represents a number) using VALUE (FormulaTextField), I got no Syntax, however, when looking at the Opportunity layout, the formula field is showing an error "#Error!". 

Would appreciate your help. Thanks!

Kevin Hart 3Kevin Hart 3
That generally means the text being passed in can't be converted to a number (does it contain something other than numbers such as letters, spaces or punctuation?). If you provide an example of the text and the formula I may be able to provide a little more specific suggestion, but make sure you are trimming white space and not passing colons etc.
Kevin BarnettKevin Barnett

Hey Kevin, is there anyway to convert to a number if the text field contains both numbers & letters? I have a similar problem as OP here. I have a text field that gets mostly numbers inputted, but sometimes also words example...

5
4 parts
6 plastic pieces
2

Is there anyway to write a new formula field (number) that will just pull the numbers from these text fields?
 

Kevin HartKevin Hart
Hi Kevin, you've got a whole series of numbers here, so it is hard to know what type of single number you are wanting at the end of the day, but let's look at a few possibilities.

First let me start by saying it would be much better to sanitize the input by using a number field or writing a validation rule to only allow numbers to be input if possible. If you are dealing with multiple values you could use a master detail custom object to have fields for both the description and the quantity separately and use a rollup field to add, subtract, etc. rather than placing all the data in a text field. 

If those aren't options then you still have some possibilities:
1. If you just want that first number 5: you could write a formula to strip everything after the first whitespace character
2. You could use a formula with find to locate specifc values or substitute to remove the alpha characters you don't want to end up with a number that is them just concatenated (lumped) together such as 5462
3. Instead of a formula you could add another number field and use a process builder/flow combo to parse the data into a collection and perform math on the collection such as addition, subtraction, etc. or could use Apex to parse it in a similar fashion.
 
Kevin BarnettKevin Barnett
Hi Kevin,

I just want to copy the number in the text field into a new field. In an ideal world, I'd just create a new number field, but the powers that be don't want to because they want to track all the data that's already in the existing text field, but they can't sum/average/etc the data in reports because it's a text field and often has words. I know i could do VALUE() for the text fields that just have a single number, but I'm not sure what to do when they have words as well
mayur bhavsar 5mayur bhavsar 5
best good morning quotes (https://www.planmymoment.com/good-morning/) and best toilet brushes reviews (https://reviewsclub.in/best-toilet-brushes/)
mohan bhatt 2mohan bhatt 2
AwsmHeart is Collection Of Latest Hindi Shayari and Quotes
Visit AwsmHeart is Collection Of Latest Hindi Shayari and Quotes (https://www.awsmheart.com/)

 
william smith 53william smith 53
You want to book an air ticket, then visit American Airlines official site (https://americanairlinesreservation.org/) to make your vacations and meetings comfortable. Check out our online portal for American Airlines Reservations (https://americanairlinesreservation.org/)  and get the best discount and offers on your bookings. If you want more concessions, then call on our support number.
Maddy ParkerMaddy Parker
Benefits and benefits are there for you when you make your journey with jetblue airlines (https://airlinesreservation.org/jetblue-airlines/). You get an opportunity to book affordable flights on this airlines. The expenses of air traveling strikes us so why not book with best airlines. This airlines is also dedicated committed to offer convenient and comfortable service to all customers. Special services to fliers who need additional assistance, including individuals with disabilities and unaccompanied minors, with the attention, respect and care they deserve. They also promised to get to your destination on time without any delays. They believe in providing positive journey to passengers so that they are proud off and also, employees should feel like working every day. jetblue airlines flights (https://airlinesreservation.org/jetblue-airlines/) is designed to provide all important benefits and facilities in your journey that you require in your journey. With ample of services and opportunities, this airlines is becoming one of the best leader in Air travel industry.
Altamash JavierAltamash Javier
Download Housefull 4 full movie from here mkvflex.com/housefull-4-full-movie (https://mkvflex.com/housefull-4-full-movie-download-720p-leaked-online/)
Quote StatusQuote Status
QuoteStatus.net is one of the India's best website for downloading high quality Quotes, DP, Images and Whatsapp status video song download free mp4. Fresh contents are added several times a day. Whatever latest trending songs and albums (https://quotestatus.net/)are launched on YouTube, you can find them all here within a few hours of it's launch. If you are looking for festival greetings and wishes, this the place for it. One of the best destinations for downloading 30 seconds whatsapp status video download. 
Aleksandr MarkovAleksandr Markov
Great information and inclusive answers. We will be glad to implement it to our website (https://snoremagazine.com)
Best, Alex
jordan john 3jordan john 3
Magellan GPS Update (http://magellangpsupdates.org) is built with G-Sensor from which axis movement is continually monitored and that possibly can stop the risk of an accident. It records your vehicle's movements with stamped GPS location, time, and date data so you have a detailed account of an accident or event.
 
jordan john 3jordan john 3
Garmin Express is a software designed by the company to manage and update your Garmin devices from a single place. You can download and install the Garmin Express on your desktop from the link garmin.com/express online. The software also allows you to transfer your daily activity and other data to the Garmin Connect account without any trouble.  
http://www.garminexpress.support
jordan john 3jordan john 3
Mcafee.com/activate - Mcafee provide complete range of security for your software and devices. Mcafee is the most simplest and effective way to protect your data and devices from Cyber threats.Mcafee scans malware for your device and provide security solution recommendation. It also scans your browser history seamlessly. You can customize how often you want your computer to be scanned with Mcafee.
http://www.mcafeecomactivatee.uk
Joy BingJoy Bing
With AOL Download you can now easily access your mails and stay updated. With AOL Download for the desktop, you will get all updates on your mails promptly.
 
Joy BingJoy Bing
Trend Micro is a market leader in providing the most secure services platform for cloud builders. To ensure your data security, do the Trend Micro Download now. With us, you can now secure your physical, virtual, cloud, and container environments more effectively with a single solution.
 
Joy Bing 3Joy Bing 3
With Avast Login you can ensure that your device is safeguarded from the threat of viruses that can harm your system. 
 
Joy Bing 3Joy Bing 3
With the latest version of AOL Download for Desktop, brings for you the opportunity to stay updated always on your mails. With AOL Download you never miss out on any update on your AOL Mail.
 
mayur bhavsar 5mayur bhavsar 5
thsi solution is great and so informative. see also good morning wishes (https://www.planmymoment.com/good-morning/)
Joy Bing 3Joy Bing 3
AOL Mail is the first choice of users across the globe. Because of the ease of use that this email service comes with, most users opt for them only. You can now access your AOL Mail Login from any of your devices easily. 
 
Joy Bing 3Joy Bing 3
The Webroot Download process is amongst the easiest process that can be done on your own. Webroot security solutions are your ultimate answer to all your device security needs. With Webroot Login, you get top-notch cybersecurity solutions for all your connected devices. 
 
Joy Bing 3Joy Bing 3
Microsoft Office is a family of various software that brings together the best tools for the way people work. Microsoft Office has the ability to change the way you work for the better. So don’t wait, complete the process of Office Setup now and make sure you get the best from the various software they have. For More Info visit Office.Com/Setup.
 
jordan john 4jordan john 4
Anti-Virus Guard(AVG) is an antivirus software that provides protection to thousands of businesses against viruses, malware, ransomware, adware, trojans, and other threats.  AVG Login (http://avgloginz.com)
 
jordan john 4jordan john 4
Norton.com/nu16 (http://mynortonnu16.com) is a simple, user-friendly process that grants you to experience the amazing features of this application. This process requires three simple steps, namely Download, Installation, and Activation. 
 
jordan john 4jordan john 4
Webroot.com/safe (http://www.iwebrootcomsafe.com) - Webroot is an efficient antivirus setup that provides you hassle free security for your device. Webroot is recognized as one of the best antiviruses in this globe. 
 
Joy BingJoy Bing
Office Setup is a family of various software that brings together the best tools for the way people work. Follow the steps we provide for office.com /setup on your preferred device successfully. 
 
jordan john 4jordan john 4
Bitdefender Central (http://bitdefender-centralx.com) is a web platform where users can easily create a Bitdefender account. It helps users in managing their various Bitdefender products and services on different devices from one single account. 
 
jordan john 4jordan john 4
one can choose Mcafee antivirus because it secures your device impeccably. It gives all in one protection for your devices like PCs, Macs, Smartphones and Tablets. Mcafee.com/activate
 
Joy BingJoy Bing
AOL Desktop Gold Download is one step forward to the effort of staying connected always. Adding AOL Gold to your Desktop will give you access to easy connectivity with the world via Emails. Do Not miss out on the world stay updated with AOL always.
 
king guruking guru
Great Work,
It is a nice Post. It was very helpful to me. Thank you for sharing this with us.
for Chalisa (https://www.kahanihindi.com/hanuman-chalisa/), Good Morning Images (https://www.kahanihindi.com/good-morning-images/) and attitude status (https://www.kahanihindi.com/attitude-status/). 
webroot loginwebroot login
Webroot Login – webroot is superb antivirus in USA ,Uk ,etc. This software has 1 million download on windows,mac,ios,etc .Doing login to the webroot antivirus , you will be more comfortable to access your detail such as subscription,renewal,installation guide,etc.

http://webrootloginz.com (http://webrootloginz.com" style="color:blue; text-decoration:underline" target="_blank)

https://webrootcomsafes.us (https://webrootcomsafes.us" style="color:blue; text-decoration:underline)
 
Joy BingJoy Bing
If you have just bought a Canon product you must be looking out for easy ways to complete your Canon Printer Setup. We bring for you the simplified procedure of Canon Printer Setup via Canon.com/ijsetup. You can read the step by step guide that we bring for you and then easily do your Canon Printer Setup on your own. 
 
Joy BingJoy Bing
In order to start using the HP Product, you first need to setup your device using 123.hp.com. Certain users face the issue of difficulties in 123.hp.com/setup. If you too are getting any difficulties in the process of setup, Reach out to our experts at Hp.com/123. you can also read the process here at our website. 
 
Joy BingJoy Bing
Norton Login is your access to easy and quick protection for your devices. Get Norton Antivirus in order to stay protected from threats of virus and malware.
 
Joy BingJoy Bing
Office Setup is a family of various software that brings together the best tools for the way people work. Follow the steps we provide for Office.com /setup on your preferred device successfully. 
 
flora davisflora davis
If you are facing any issues regarding Norton, webroot, Bitdefender, Garmin , Rand Mcnally , Magellan  Mcafee login , Turbotax login , malwarebytes login , quicken support ,  Existential Crisis , online therapy and digital marketing course in delhi you will get an instant online solution. For more details visit this link which is given below:

Norton.com/setup (http://www.nortoncom-setupz.com/)| webroot.com/safe (http://www.webrootcomsafex.com/)|Bitdefender central (http://bitdefender-centrals.com/)| Garmin.com/express (http://garmincomexpressz.com/)| Rand Mcnally dock (http://randmcnallydockz.com/)| Magellan GPS Update (http://magellangpsupdatee.com/)|  Mcafee login (http://mymcafeelogin.com/)| Malwarebytes login (http://malwarebytesloginz.com/)| Quicken support (https://myquickensupport.com/)| Turbotax login (https://myturbotaxlogin.com/)|
hindi droidhindi droid

SarkariResult Com Hindi 2020 - Sarkari Naukri Info, एडमिट कार्ड और सरकारी रिजल्ट Online Form २०२० (https://www.hindidroidblog.com/2020/01/sarkariresult-com-hindi.html)
flora davisflora davis
Find a counselor and talk confidentially with Vcaretherapy online therapy (https://vcaretherapy.com/) services, anyone can get therapy without traveling to any place.
Existential Crisis| (https://vcaretherapy.com/what-is-existential-crisis-and-why-do-we-need-help/)


 
flora davisflora davis
BISDM offers an extensive Digital Marketing Course in Delhi for the students, startups, as well as entrepreneurs. Here at BISDM, we try to deliver quality training along with practical experience. We explicitly designed our courses to help students and entrepreneurs to achieve their goals of reaching the targeted audience. Industry Experts and Trendsetters are going to be your trainers at BISDM. You will be going to experience the interactive live class training here.
More info: Digital Marketing Course in Delhi (https://bisdm.com/)
Joy BingJoy Bing
Hulu is a perfect friend for all the times when you have to keep yourself entertained. This is so because it is amongst the site that not only brings you the latest content. But, you can also get the critically acclaimed and award-winning content via Hulu Originals. You deserve an uninterrupted and clear streaming experience with Hulu Login. In order to initiate your experience, you need to create an account and then activate your product using www.hulu.com/activate
 
Book daniel wickBook daniel wick
I was tired of searching for similar information ubiquitously and at last, I got it all here. Hey there, I am an employee working at American Airlines Book A Flight (https://bookaflight.us/american-airlines/). I offer assistance to the customers who are in need of quick customer support for our services. We have great offers and deals waiting for you. Contact us anytime!
Carol WoodCarol Wood
Excellent thread, I have to thank for this. It helps me a lot to enhance my knowledge. I really like the way the writer presented his views. assignment help Sydney (https://www.essaycorp.com/assignment-help-sydney)