# SharePoint Calendar: Color Code Events by Category

> For the full documentation index, see https://250highstreet.com/llms.txt

> Color code a SharePoint calendar by category with Format current view in the modern calendar. Add the column to the view first, then set rules or JSON.

In a modern SharePoint list calendar view, you color events by adding the Category column to the view and then setting formatting rules with Format current view. Microsoft's calendar formatting uses the additionalEventClass property, which takes SharePoint color classes.

## What do you set up first?

Microsoft's calendar formatting article says to add every column you will use in JSON formatting before you create the calendar view. If you need more columns later, add them through List Settings.

A Microsoft Q&A moderator answer suggests adding Category to the view's columns before building rules.

## How do you apply the rules?

1. Open the list's calendar view and use Add or remove fields to check the Category column.
2. Select Format current view.
3. Build conditional formatting rules on the Category column, or open Advanced mode to paste JSON.
4. Save the view and check a few events.

## What does the JSON look like?

```
Sample: {"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/calendar-formatting.schema.json", "additionalEventClass": "=if([$Category] == 'Meeting', 'sp-css-backgroundColor-successBackground50', if([$Category] == 'Holiday', 'sp-css-backgroundColor-errorBackground50', 'sp-css-backgroundColor-neutralBackground20'))"}. Meeting events get one background, Holiday events another, and everything else a neutral one.
```

## What if Category is missing from the rules?

The same moderator offers a fallback: temporarily set Title of items on calendar to Category, build the rules, then set the title back. The moderator says the rules usually keep working after that, but it is not guaranteed and is guidance rather than documented behavior.

Microsoft's example formats by a single choice column and sets different styles for selected and unselected events using @isSelected.

## Related fixes

For a calendar that fails to show another list, read [SharePoint calendar overlay not showing](/guides/sharepoint-calendar-overlay-not-showing/). For colors in a normal list view, read [color code a choice column](/guides/color-code-choice-column-sharepoint-list/). A calendar that planners use daily is covered in [content calendar in SharePoint](/guides/content-calendar-sharepoint/).

## FAQ

### Which property colors calendar events?

additionalEventClass, in the calendar formatting schema.

### Can I color by a column other than the title?

Yes. Microsoft's own calendar formatting example colors events by a single choice column, PROJECT, through additionalEventClass. Add the column to the list before you build the view.

### Does the formatting use hex colors?

The example in the Microsoft Q&A answer uses SharePoint class names such as sp-css-backgroundColor-successBackground50, not hex codes.

### Do I need to add the column to the view?

Yes. Microsoft's article says to add the columns you will use before creating the calendar view.

## Sources

- [Format calendar view to customize SharePoint](https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-calendar-formatting)
- [Question about modern Calendar/List on SharePoint Online (Microsoft Q&A)](https://learn.microsoft.com/en-us/answers/questions/5852622/question-about-modern-calendar-list-on-a-sharepoin)

## Related guides

- [SharePoint Calendar Overlay Not Showing a List: Fix](/guides/sharepoint-calendar-overlay-not-showing/)
- [Color-Code a Choice Column in a SharePoint List](/guides/color-code-choice-column-sharepoint-list/)
- [Content Calendar in SharePoint: List Setup](/guides/content-calendar-sharepoint/)
- [Recurring events in a SharePoint calendar](/guides/sharepoint-calendar-recurring-events/)
- [SharePoint list form stuck on Getting your data](/guides/sharepoint-form-stuck-on-getting-your-data/)

Source: https://250highstreet.com/guides/sharepoint-calendar-color-code-by-category/
