50+ Salesforce Formulas to Supercharge Your Productivity
Salesforce formula fields are one of the most powerful tools in the platform — they allow you to automate calculations, enforce consistency, and create dynamic logic without writing a single line of code.
In this blog, we’ve curated 50+ powerful and practical Salesforce formula examples, grouped by use case, to help you work smarter, not harder.
1. Text Manipulation Formulas
- Capitalize the First Letter of Each Word
formula
CopyEdit
INITCAP(Name)
- Combine First and Last Name
formula
CopyEdit
FirstName & ” ” & LastName
- Extract Domain from Email
formula
CopyEdit
RIGHT(Email, LEN(Email) – FIND(“@”, Email))
- Check if Text Contains a Word
formula
CopyEdit
CONTAINS(Description, “urgent”)
- Text Length
formula
CopyEdit
LEN(Comments__c)
2. Date & Time Formulas
- Calculate Age
formula
CopyEdit
FLOOR((TODAY() – Date_of_Birth__c) / 365)
- Days Since Created
formula
CopyEdit
TODAY() – CreatedDate
- Add 30 Days to Date
formula
CopyEdit
CreatedDate + 30
- Check if Close Date is Overdue
formula
CopyEdit
IF(CloseDate < TODAY(), “Overdue”, “On Track”)
- Time Difference in Hours
formula
CopyEdit
(NOW() – CreatedDate) * 24
3. Math & Logic Formulas
- Calculate Discount Percentage
formula
CopyEdit
((Original_Price__c – Discounted_Price__c) / Original_Price__c) * 100
- Sales Commission
formula
CopyEdit
IF(Amount > 10000, Amount * 0.1, Amount * 0.05)
- Safe Division (Avoid Divide by Zero)
formula
CopyEdit
IF(Quantity__c = 0, 0, Total__c / Quantity__c)
- Round to 2 Decimal Places
formula
CopyEdit
ROUND(Number__c, 2)
4. Checkbox/Boolean Logic
- Mark High-Value Opportunity
formula
CopyEdit
IF(Amount > 50000, TRUE, FALSE)
- Opportunity Close This Month
formula
CopyEdit
IF(CloseDate >= TODAY() && CloseDate <= EOMONTH(TODAY(), 0), TRUE, FALSE)
- Account is Inactive for 90+ Days
formula
CopyEdit
TODAY() – LastActivityDate > 90
5. Conditional Display Formulas
- Show “Hot Lead” Badge
formula
CopyEdit
IF(Rating = “Hot”, IMAGE(“/img/samples/star_red.gif”, “Hot Lead”), “”)
- Color Code Opportunities by Stage
formula
CopyEdit
CASE(StageName,
“Closed Won”, IMAGE(“/img/samples/flag_green.gif”, “Won”),
“Closed Lost”, IMAGE(“/img/samples/flag_red.gif”, “Lost”),
IMAGE(“/img/samples/flag_blue.gif”, “Open”))
6. Validation Helper Formulas
- Prevent Close Date in Past
formula
CopyEdit
CloseDate < TODAY()
- Phone Number Must Be 10 Digits
formula
CopyEdit
LEN(Phone) != 10
- Ensure Required Field When Checkbox is True
formula
CopyEdit
Checkbox__c && ISBLANK(Details__c)
7. User & Record Owner Formulas
- Get Owner’s First Name
formula
CopyEdit
Owner.FirstName
- Check if Current User is Record Owner
formula
CopyEdit
$User.Id = OwnerId
- Show Manager Name
formula
CopyEdit
User.Manager.FirstName & ” ” & User.Manager.LastName
8. URL & Hyperlink Formulas
- Clickable Website URL
formula
CopyEdit
HYPERLINK(Website, “Visit Site”)
- Google Maps Location
formula
CopyEdit
HYPERLINK(“https://maps.google.com/?q=” & BillingStreet & “, ” & BillingCity, “Map It”)
- Open Related Record in Lightning
formula
CopyEdit
HYPERLINK(“/” & Related_Record__c, “Open Record”)
9. Record Type & Picklist Handling
- Display Record Type Name
formula
CopyEdit
RecordType.Name
- Conditional Value Based on Picklist
formula
CopyEdit
CASE(Industry,
“Technology”, “Tech Vertical”,
“Finance”, “Fin Vertical”,
“Other”)
- Is Picklist Empty
formula
CopyEdit
ISPICKVAL(Status__c, “”)
10. Advanced Business Logic
- Show Last Modified User & Date
formula
CopyEdit
“Modified by: ” & LastModifiedBy.Name & ” on ” & TEXT(LastModifiedDate)
- Multi-Stage Conditional Logic
formula
CopyEdit
IF(Stage = “Prospecting”, “Early”,
IF(Stage = “Proposal”, “Mid”,
IF(Stage = “Negotiation”, “Late”, “Other”)))
- Region Based on State
formula
CopyEdit
CASE(State__c,
“CA”, “West”,
“NY”, “East”,
“TX”, “South”,
“Other”)
Tips for Using Formula Fields Effectively
- Keep it simple: Break down complex logic into multiple formulas.
- Use comments in your formulas using /* */ for clarity.
- Always test in sandbox before deploying to production.
- Use Custom Labels for reusable text.
- Check for nulls and blanks to avoid runtime errors.