2

I'm trying to make this by Excel rules:
Spreadsheet example

That any cell (in column B) that is near (beside) "1" (in A) will be red, and any cell near (beside) "2" will be green.
Is there a possible way to do it (without VBA, only with excel rules)?

4
  • 1
    What is "near"? Do you mean equal? Commented Mar 24 at 12:46
  • 1
    Yes what do mean near here? If you meant to say only its equal to 1 or 2 then select the range B, Goto CF (ALT+H+L+N <-- Shortcut to open), Select the last rule and enter the formula as =A1=1 click format to choose preference and select OK twice done. Same way for 2. If not then explain more. Also numbers shouldn't be within speechmarks/quotes. Commented Mar 24 at 12:49
  • I hope now it's more clear :) @ReddyLutonadio
    – Yoar
    Commented Mar 24 at 13:12
  • 1
    Yes, and it works! :) Thank you! @MayukhBhattacharya
    – Yoar
    Commented Mar 24 at 13:38

1 Answer 1

2

You need to use Conditional Formatting using the last rule --> Use a formula to determine which cells to format

enter image description here


  • Select the Column B range from B1:B8
  • GoTo Home Tab --> From Styles Group --> Click on Conditional Formatting --> Click New (Alternatively, shortcut to open the New Formatting Rule window box is --> ALT+H+L+N )
  • Select the last rule --> Use a formula to determine which cells to format
  • In the edit the rule description enter the following formula:

=A1=1


  • Click Format --> Choose your preferences.
  • Click OK -> Twice. Done.

Same way for 2 repeat the process but change A1=2 and change the formatting. Or you can select the range B1:B8 press ALT+H+L+R to open Conditional Formatting Rules Manager --> Click Duplicate --> Click on Edit --> Change in the rule description 1 to 2 and change the formatting press OK done.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .