On this page, I have collected all my Salesforce formulas and functions tutorials in one place so that you can quickly find the exact example you need for your business requirement.
Whenever you get stuck on a formula, you don’t need to search all over the web. You can bookmark this Salesforce Formulas & Functions Library and use it as your personal reference to:
- Copy ready‑to‑use Salesforce formula patterns.
- Learn how individual Salesforce functions work, with syntax and examples.
- Discover new ideas to simplify automation, validation rules, and reports.
I have organized the tutorials by category — dates, text, logical, numeric, picklists, cross‑object, reporting, and more — and at the end, you will also find a complete index of all my formula and function articles.
How I recommend you use this library
Here is how I suggest using this Salesforce formulas and functions hub:
- If you are new to formulas, start with date formulas and logical functions.
- If you are an Admin or Consultant, keep this page open while building validation rules, formula fields, and Flow expressions.
- If you are a Developer or Architect, use it as a quick reference for function behavior and tricky edge cases.
You can scroll by section when you know the category (for example, date formulas), or jump to the full index at the end if you know the function name.
Salesforce Date Formulas and Date/Time Functions
Date formulas are the backbone of SLAs, due dates, renewals, and age calculations. I use these patterns in almost every project.
Start with a general overview of date formulas and date functions:
- Date Formula Functions in Salesforce
- Salesforce Date Function
- Salesforce Datevalue Function
- Salesforce Timevalue Function
- Salesforce Today Function
- Salesforce Hour Function
- Salesforce Month Function
- Salesforce Year Function
Frequently used Salesforce date formula patterns:
- Salesforce Formula to Calculate Days Between Dates
- Add Days to Date in Salesforce Formula
- Salesforce Formula Add Year to Date
- Salesforce Date Formula Business Days
- Salesforce Date Range Formula
- Salesforce Due Date Formula
- Salesforce Formula Date Greater Than Specific Date
- Salesforce Formula Date Less Than Today
- Salesforce Formula Date to Text
- Salesforce Formula Datetimevalue
- Salesforce Fromunixtime Function
- Salesforce Unixtimestamp Function
- Salesforce Timenow Function
- Salesforce Weekday Formula
- Salesforce Last Activity Date Formula
- Salesforce Formula to Get Last Day of Month
- Extract Year From Date Salesforce Formula
With these examples, you can handle most date‑related use cases like SLAs, follow‑up reminders, aging, and contract renewals.
Salesforce Text Formulas and String Functions
Text formulas help you clean data, format labels, generate URLs, and display user‑friendly messages.
Core Salesforce text functions:
- Text Function in Salesforce
- Left Function in Salesforce
- Salesforce Right Function
- Mid Function in Salesforce
- Len Function in Salesforce
- Salesforce Trim Function
- Upper Function in Salesforce
- Substitute Function in Salesforce
- Begins Function in Salesforce
- Contains Function in Salesforce
- Find Function in Salesforce
- Salesforce Reverse Function
- Lpad Function in Salesforce
Formatting helpers for better UX:
- Hyperlink Function in Salesforce
- Image Function in Salesforce
- Br Function in Salesforce
- Salesforce Soql Tolabel Function
I use these patterns for things like:
- Building dynamic links to records and reports.
- Formatting addresses and labels.
- Extracting parts of a string (for example, prefixes, codes, or domain names).
Salesforce Logical Functions (IF, AND, OR, ISBLANK, CASE, etc.)
Logical functions are the “brain” of your formulas. They control when rules fire and what values you show.
Key logical and control functions:
- Salesforce If Function
- Salesforce And Function
- or Function in Salesforce
- Salesforce Not Function
- Case Function in Salesforce
Null and value detection functions:
- Salesforce Isblank Function
- Salesforce Isnull Function
- Salesforce Nullvalue Function
- Salesforce Blankvalue Function
- Salesforce Isnumber Function
Record‑state helpers:
- Salesforce Isnew Function
- Salesforce Isclone Function
- Ischanged Function in Salesforce
- Salesforce Priorvalue Function
These are essential in:
- Validation rules (for example, only enforce a rule when a field changes).
- Formula fields that show different messages or values based on conditions.
- Process builder and Flow formulas that decide which path to take.
Salesforce Numeric and Math Functions
Numeric functions are useful for scoring, calculations, thresholds, and anything involving numbers.
Key numeric functions:
- Abs Function in Salesforce
- Ceiling Function in Salesforce
- Mceiling Function in Salesforce
- Floor Function in Salesforce
- Round Function in Salesforce
- Mod Function in Salesforce
- Exp Function in Salesforce
- Sqrt Function in Salesforce
- Max Function in Salesforce
- Min Function in Salesforce
- Salesforce Value Function
- Trunc Function in Salesforce
- Salesforce Currencyrate Function
- Salesforce Formatduration Function
I rely on these functions for:
- Calculating scores, percentages, and thresholds.
- Rounding and formatting numeric outputs.
- Multi‑currency logic and duration calculations.
Picklist and Checkbox Formulas
Picklist and checkbox formulas are very common in real projects, especially when driving business logic or UI behavior.
- Ispickval Function in Salesforce
- Picklistcount Function in Salesforce
- Salesforce Picklist Default Value Formula
- Salesforce Checkbox Formula
These patterns are useful when:
- You need to default a picklist based on other fields.
- You want to control visibility or validation depending on a checkbox or picklist.
- You want to count how many values are selected in a multi‑select picklist.
Cross‑object Salesforce Formulas and ID‑related Functions
Cross‑object formulas and ID handling often come up when you want to show parent data or work with IDs safely.
- Create Cross Object Formula Fields in Salesforce
- Create Formula Field Type in Salesforce
- Create Row Level Formula in Salesforce Report
- Casesafeid Function in Salesforce
- Salesforce Vlookup Function
I use these when:
- I need to show information from parent or related records without creating redundant fields.
- I must convert 15‑character IDs to 18‑character IDs safely.
- I want to “look up” values based on other fields inside a formula.
Geolocation Formulas and Distance Calculations
If you are working with territories, proximity, or location‑based routing, these geolocation functions are helpful.
You can use these to calculate distances between two locations and incorporate that into assignment or territory logic.
Salesforce Reporting Formulas (row‑level and report‑level)
You don’t always need a formula field on the object; sometimes a report‑level formula is enough.
Combine these with the date and text functions above to create powerful summaries and KPIs directly in reports.
Using formulas inside Salesforce Flow
Formulas are not only for fields and validation rules; you also use them heavily inside Flows.
If you are following my Flow tutorials, this article shows how to apply the same formula logic in Flow expressions, decisions, and assignments.
Advanced and Utility Salesforce Functions
Some functions don’t fit neatly into the categories above but are still very useful in specific scenarios.
- Ascii Function in Salesforce
- Initcap Function in Salesforce
- Getsessionid Function in Salesforce
- Salesforce Regex Function
I use these when I need to:
- Validate complex text patterns (with REGEX).
- Work with characters or capitalization in a special way.
- Understand more advanced behavior when integrating with other tools.
Tableau Functions for Salesforce Professionals
If you are also working with Tableau on top of Salesforce data, these Tableau function tutorials will help:
- Tableau Aggregate Functions
- Tableau Attr Function
- Tableau Fixed Function
- Tableau Lookup Function
- Tableau Rank Function
- Tableau Split Function
- Tableau Zn Function
These are especially useful if you are building analytics or dashboards that combine Salesforce and Tableau.
Full Index: All Salesforce Formula and Function Tutorials
Here is a complete index of all my Salesforce formula and function tutorials so far. If you know the name of a function or you are exploring ideas, you can scan this list quickly.
- Abs Function in Salesforce
- Acos Function in Salesforce
- Add Days to Date in Salesforce Formula
- Ascii Function in Salesforce
- Begins Function in Salesforce
- Br Function in Salesforce
- Case Function in Salesforce
- Casesafeid Function in Salesforce
- Ceiling Function in Salesforce
- Contains Function in Salesforce
- Create Cross Object Formula Fields in Salesforce
- Create Formula Field Type in Salesforce
- Create Row Level Formula in Salesforce Report
- Date Formula Functions in Salesforce
- Distance Function in Salesforce
- Exp Function in Salesforce
- Extract Year From Date Salesforce Formula
- Find Function in Salesforce
- Floor Function in Salesforce
- Geolocation Function in Salesforce
- Getsessionid Function in Salesforce
- Hyperlink Function in Salesforce
- Image Function in Salesforce
- Includes Function in Salesforce
- Initcap Function in Salesforce
- Ischanged Function in Salesforce
- Ispickval Function in Salesforce
- Left Function in Salesforce
- Len Function in Salesforce
- Lpad Function in Salesforce
- Max Function in Salesforce
- Mceiling Function in Salesforce
- Mid Function in Salesforce
- Min Function in Salesforce
- Mod Function in Salesforce
- or Function in Salesforce
- Picklistcount Function in Salesforce
- Round Function in Salesforce
- Salesforce And Function
- Salesforce Blankvalue Function
- Salesforce Checkbox Formula
- Salesforce Currencyrate Function
- Salesforce Date Formula Business Days
- Salesforce Date Function
- Salesforce Date Range Formula
- Salesforce Datevalue Function
- Salesforce Due Date Formula
- Salesforce Formatduration Function
- Salesforce Formula Add Year to Date
- Salesforce Formula Date Greater Than Specific Date
- Salesforce Formula Date Less Than Today
- Salesforce Formula Date to Text
- Salesforce Formula Datetimevalue
- Salesforce Formula Field to Calculate Age
- Salesforce Formula Field to Check Null Values for Dates
- Salesforce Formula for Text Field
- Salesforce Formula to Calculate Days Between Dates
- Salesforce Formula to Get Last Day of Month
- Salesforce Fromunixtime Function
- Salesforce Hour Function
- Salesforce If Function
- Salesforce Isblank Function
- Salesforce Isclone Function
- Salesforce Isnew Function
- Salesforce Isnull Function
- Salesforce Isnumber Function
- Salesforce Isoweek Function
- Salesforce Last Activity Date Formula
- Salesforce Month Function
- Salesforce Not Function
- Salesforce Now Function
- Salesforce Nullvalue Function
- Salesforce Picklist Default Value Formula
- Salesforce Priorvalue Function
- Salesforce Regex Function
- Salesforce Reverse Function
- Salesforce Right Function
- Salesforce Soql Tolabel Function
- Salesforce Timenow Function
- Salesforce Timevalue Function
- Salesforce Today Function
- Salesforce Trim Function
- Salesforce Unixtimestamp Function
- Salesforce Value Function
- Salesforce Vlookup Function
- Salesforce Weekday Formula
- Salesforce Year Function
- Sqrt Function in Salesforce
- Substitute Function in Salesforce
- Tableau Aggregate Functions
- Tableau Attr Function
- Tableau Fixed Function
- Tableau Lookup Function
- Tableau Rank Function
- Tableau Split Function
- Tableau Zn Function
- Text Function in Salesforce
- Trunc Function in Salesforce
- Upper Function in Salesforce
- Use Date Formula in Salesforce Report
- Use Formulas in Salesforce Flow