There is no difference in calculated column formula in SharePoint Online from earlier versions of SharePoint. Let us see an detailed example in this article.
I have a column called “Activities” that is a choice column and has the following options:
- Bylaw Development – Working Papers
- Compliance Monitoring – Permitted Activities
I need to have 2 calculated columns to get split the ‘Activities’ choice – one for Activity and one for Subactivity. For ‘Activity’, I need to get everything to the left of the ” – ” and for ‘Subactivity”, I need to get everything to the right of the ” – “.
For example: For Bylaw Development – Working Papers, the activity should be ‘Bylaw Development’ and the subactivity should be ‘Working Papers’.
Step 1 : Create two columns “Activity” and “Subactivity” as a Single line text
Step 2: Create column “Activities” as below,
Step 3: Enter the items as below,
Step 4: All item view should display as below,
Hope this article help. This article is applicable to other version of SharePoint too.