Home » excel » excel – Conditional formatting with *

excel – Conditional formatting with *

Posted by: admin May 14, 2020 Leave a comment

Questions:

How can I set up a conditional formatting by using * ?
The conditions are:

If the nr. is >=1500 it shows ****

If the nr. is between 1000 and 1500 it shows ***

If the nr. is between 500 and 1000 it shows **

and if the nr is <500 it shows *

An example is below:
https://i.stack.imgur.com/8AuTP.png

And after conditional formatting should be like this:
https://i.stack.imgur.com/otPRy.png

I ve tried everything but nothing works..

How to&Answers:

You can create four different conditional formatting rules or use one custom number format for two conditions with a default and one CFR to split the default.

First select B2:whatever and set the number format to,

[>=1500]"****";[>=1000]"***";"**";

Next (with the same range selected) create a new CFR based upon the following formula,

=b2<500       'B2 is the upper-left-most cell in the selection 

Click Format and set a new custom number format of

"*"

Click OK to accept the format then OK again to create the custom number format.

enter image description here

Answer:

You can do:

=IF(A1>1500,”****”,IF(A1>1000,”***”,IF(A1>500,”**”,”*”)))

Note that you can put >= if you want 1500 instead of 1501.

You could also use vlookup, with 1500 in cell B1 and **** in cell C1, 1000 in B2 etc, and

=Vlookup(A1,$B$1:$C$4,2,1)

Neither tested as I am on a smartphone, sorry, but the if() should be fine, the vlookup may need the * entered as text…