Create a Formula Field

Follow Along with Trail Together

Want to follow along with an instructor as you work through this step? Take a look at this video, part of the Trail Together series on Trailhead Live. 

(This clip starts at the 41:00 minute mark, in case you want to rewind and watch the beginning of the step again.)


A formula field performs a calculation or populates data between fields to reduce errors—and help keep things nice and clean. They output read-only numbers, text, or date/time values and can access related data with merge fields. Note that the calculated value is not stored, but rather calculated each time data is read. Use formula fields to improve data quality by deriving values from other fields and preventing redundant data.

Display Revenue on an Opportunity Record

Allison Wheeler has another keep-it-tidy task for you. She wants all opportunities to show the annual revenue of the account. Since Annual Revenue is already a field on the Account object, this information must appear on the Opportunity object without duplicating the data already being stored.

Create a formula field to display the account annual revenue on opportunity records.

  1. From Setup, click the Object Manager tab.
  2. Click Opportunity, click Fields & Relationships, then click New.
  3. Select Formula, then click Next.
  4. In the Field Label field, enter Account Annual Revenue.
  5. Select Currency, then click Next.
  6. Click the Advanced Formula tab.
  7. Click Insert Field and select Account > from the second list.
  8. From the new list that appears, select Annual Revenue, then click Insert.
  9. Verify that the formula looks like this:
    • Account.AnnualRevenue  Annual Revenue Opportunity Object Formula Screenshot
  10. Click Check Syntax.
  11. In the Description field, enter Displays the account annual revenue on an opportunity.
  12. Click Next.
  13. Leave the field-level security as is, and click Next.
  14. Click Save.

Now that you’ve put the kibosh on redundant data with a formula field, continue keeping things clean in the next step of this project, where you do some filtering.

Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities