I have been asked to fill a custom field named "Group" with the Case's Owner Queue Name.
I have created a formula field like this

    CASE(
            Owner:Queue.Id, 
            '00Gw0000002RvtS', "Gruppo A - Operations", 
            '00GZ0000001ls0m', "Gruppo B1 - TP_Service",
            "00Gw0000002RvtU", "Gruppo B2 - Infogroup",
            "00Gw0000002RvtW", "Gruppo C - Crediti",
            "00Gw0000002RvtX", "Gruppo D - Fatturazione",
            "00Gw0000002RvtY", "Gruppo E - Commerciale",
            "00Gw0000002RvtZ", "Gruppo F - Prospect",
            "00Gw0000002Rvta", "Gruppo G - TOP",
            "00Gw0000002Rvtb", "Gruppo H - PA",
            "00GZ0000001ltX8", "Gruppo I - Recard",
            "No_Value"
    )

Now if the case owner is a queue then the result is ok, but if the owner is a User the formula doesn't work.
Is there any way to address this? I have tried to create a trigger, but I'm not a coding expert so I didn't succeed.
Any help?

Thanks in advance
Axl