You can do that with substitutions, with PHP in a Code field, or with SQL in a Query field. Our substitutions support IF, ELSEIF, and ELSE usages now so you'd have the below for example in a Custom HTML field.
[cb:if field1<"80"]2[cb:elseif field1<"40"]1[/cb:elseif][cb:elseif field1<"10"]0[/cb:elseif][cb:else]3[/cb:else][/cb:if]
See the below tutorial for further substitution usage information. Note for ELSEIF and ELSE usages you need latest CB build.
www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb