Formula to pick a value and add stars(*) in a different cell

jskasango

Board Regular
Joined
Jul 18, 2012
Messages
202
Office Version
  1. 365
Platform
  1. Windows
I need a formula to place the value from C3 to E3 and add stars(*) if D3 meets 3 conditions. 1) If D3 multiply by 2 is less than 4, one star. 2) If D3 is greater than 4 but less than 6, two stars. 3) If D3 is greater than 6, three stars.

1642711472378.png
 
The boss has not yet replied but just a quick one, how do I include (NumberFormat = "0.00") in the formula so as to suppress excess decimals?

You can ROUND C3 or use TEXT like Fluff suggested:

Book3.xlsx
CDE
3-5.192.57-5.19 *
410.892.5710.89 *
512.19512.19 **
6-19.6912.59-19.69 ***
737.15678437.16 *
Sheet948
Cell Formulas
RangeFormula
E3:E7E3=ROUND(C3,2)&IF(D3>=6," ***",IF(D3>4," **"," *"))
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You can ROUND C3 or use TEXT like Fluff suggested:

Book3.xlsx
CDE
3-5.192.57-5.19 *
410.892.5710.89 *
512.19512.19 **
6-19.6912.59-19.69 ***
737.15678437.16 *
Sheet948
Cell Formulas
RangeFormula
E3:E7E3=ROUND(C3,2)&IF(D3>=6," ***",IF(D3>4," **"," *"))
Thanks a lot! The boss has now made it even more complicated for me, he wants the formula to treat negative values as if they are positive without removing the negative (-) sign. Is this really possible? -0.01 to -4.00 "*", -4.01 to -5.99 "**", -6.00 onwards "***". Please help
You can ROUND C3 or use TEXT like Fluff suggested:

Book3.xlsx
CDE
3-5.192.57-5.19 *
410.892.5710.89 *
512.19512.19 **
6-19.6912.59-19.69 ***
737.15678437.16 *
Sheet948
Cell Formulas
RangeFormula
E3:E7E3=ROUND(C3,2)&IF(D3>=6," ***",IF(D3>4," **"," *"))
 
Upvote 0
How about
Excel Formula:
=TEXT(C3,"0.00 ")&REPT("*",IF(ABS(D3)<=4,1,IF(ABS(D3)<=6,2,3)))
 
Upvote 0
Thanks a lot! The boss has now made it even more complicated for me, he wants the formula to treat negative values as if they are positive without removing the negative (-) sign. Is this really possible? -0.01 to -4.00 "*", -4.01 to -5.99 "**", -6.00 onwards "***". Please help

This will do it:

Book3.xlsx
CDE
3-5.192.57-5.19 *
410.892.5710.89 *
512.19512.19 **
6-19.6912.59-19.69 ***
737.15678437.16 *
810.89-2.5710.89 *
912.19-612.19 ***
10-19.69-12.59-19.69 ***
1137.15678-0.0237.16 *
1212612 ***
Sheet948
Cell Formulas
RangeFormula
E3:E12E3=ROUND(C3,2)&IF(ABS(D3)>=6," ***",IF(ABS(D3)>4," **"," *"))
 
Upvote 0
Upvote 0
Another option
Excel Formula:
=TEXT(C3,"0.00 ")&REPT("*",IF(D3<=4,1,IF(D3<=6,2,3)))
The boss has changed the lock just when I MrExcel has given me the key! The new instruction is treat the values as absolute, thus from -2 to 2 "ns", from >2 to 4 "*", >4 to 6, "**", anything >6, "***". This means all negatives should be treated as positives. I hope this is possible.
 
Upvote 0
How about
Excel Formula:
=TEXT(C3,"0.00 ")&IF(ABS(D3)<=2,"ns",IF(ABS(D3)<=4,"*",IF(ABS(D3)<=6,"**","***")))
 
Upvote 0
Solution
How about
Excel Formula:
=TEXT(C3,"0.00 ")&IF(ABS(D3)<=2,"ns",IF(ABS(D3)<=4,"*",IF(ABS(D3)<=6,"**","***")))
Thanks a lot @Fluff , I hope the boss does not change the lock again! I really appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,820
Members
449,340
Latest member
hpm23

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