# How to incorporate sorting in calculated column with background and text color formatting to use as a Grouping field

Here is the calculated formula for the field:

``````=IF([AU-R CIR]="7. ERROR","<div style="""&"text-align:center; color: red; background: #ffffff"&""">7. ERROR</div>",IF([AU-R CIR]="6. Incomplete","<div style="""&"text-align:center; color: blue; background: #ffffff"&""">6. Incomplete</div>",IF([AU-R CIR]="5. High","<div style="""&"text-align:center; color: white; background: #c00000"&""">5. High</div>",IF([AU-R CIR]="4. Moderate-High","<div style="""&"text-align:center; color: white; background: #ed7d31"&""">4. Moderate-High</div>",IF([AU-R CIR]="3. Moderate","<div style="""&"text-align:center; color: white; background: #ffc000"&""">3. Moderate</div>",IF([AU-R CIR]="2. Low-Moderate","<div style="""&"text-align:center; color: white; background: #92d050"&""">2. Low-Moderate</div>",IF([AU-R CIR]="1. Low","<div style="""&"text-align:center; color: white; background: #00b050"&""">1. Low</div>")))))))
``````

I want to use it as a grouping field but the built in ordering for grouping fields does not order based on the `[AU-R CIR]` field values.

Can the calculation formula be adjusted to accommodate the ordering?