Letter code based on another cell

RSnap3232

New Member
Joined
Nov 20, 2020
Messages
45
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
hello All

was wondering how can I go about getting a cell to populate with the below letters based on a percentage in another cell;

0% = R
1% to 49% = R+
50% to 99% = A
100% = G
blank = G+
SiteCoachedNon CoachedTotal% CompliantCode
site 1
10​
1​
11
91%​
A
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You didn't say if you want a formula solution or vba code, or if either would do. I'm not great at formulas but something like this worked in my testing where AR6 contains a value that is within the ranges you posted:
=IF(AR6=0,"R",IF(AND(AR6>0,AR6<50),"R+",IF(AND(AR6>49,AR6<100),"A",IF(AR6=100,"G",IF(AR6=-1,"G+")))))

However, you would have to use numbers and not text, which means a blank cell will return the wrong value. I used -1 instead of an empty cell and the cell is formatted as a number. Perhaps nesting Isblank function could work with empty cells but I don't have time to try it right now.
 
Upvote 0
Another possible approach?

Testing Formula Update.xlsm
EF
1%Comp;iantCode
20%R
315%R+
449%R+
550%A
672%A
799%A
8100%G
9G+
101%R+
11Random text 
12101% 
Sheet2
Cell Formulas
RangeFormula
F2:F12F2=IFERROR(IF(E2="","G+",LOOKUP(E2,{0,"R";0.01,"R+";0.49,"R+";0.5,"A";1,"G";1.01,""})),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top