Editing this answer to reflect a better understanding of what you want to happen. I believe the ask is this:
- When verified complete, update to 'B'
- When ok for production, update to 'B+'
- When activated, update to 'A'.
As mentioned by Derek, formula fields don't update anything; they're calculated dynamically every time that they are viewed, but no data is stored internally. You can however simulate the above behavior with a formula field, essentially by reversing the order of your comparisons -- checking last to first.
- If activated, display 'A'
- Else if ok for production, display 'B+'
- Else if verified complete, display 'B'
- Else display 'null'
CASE(OHSI_Status__c,
"Activate",
"A",
"Ok for Production",
"B+",
CASE(Status__c,
"Verified Complete",
"B",
"null"
)
)
Alternatively, if you want to actually store the data on the record, you can create a picklist field instead of a formula field, and give it three values, 'B', 'B+', 'A'. Then, create three workflow rules that run every time the record is updated to match the criteria for their related statuses, and then perform a field update to the new picklist, with the appropriate value. There are several benefits / considerations to using a real picklist instead of a formula, including,
- Formulas can be less efficient if you have to use them in report / SOQL filters (displaying them is fine)
- Reports can provide users with the three options to filter on ('A', 'B+', 'B'), whereas report filters on formulas don't have preset values to choose from (the user has to know the three options ahead of time)
Two final notes, last I checked, formulas should use double quotes when defining string literals (Apex is single quotes). Lastly, I used case statements for the picklists above, as I find them a bit more readable than chained IFs, especially with a lot of values. But that's personal preference; both will work.