Aug 30 2023 03:21 PM
I want a cell to be colored according to the result of another Excel cell, is it possible? For example, a certain set of cells (say cells B1 to L1) turn red or green because the text of another cell (outside the set of cells to be colored, say cell A1) has a certain text1 (for green) or text2 (for red).
Aug 30 2023 03:29 PM
SolutionSelect B1:L1 (or more rows in columns B to L if you wish).
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=$A1="text1"
Click Format...
Activate the Fill tab.
Select green as highlight color.
Click OK, then click OK again.
Repeat these steps with the formula
=$A1="text2"
and red as fill color.
Aug 31 2023 12:45 PM
Hi @HansVogelaar,
Thank you very much for your answer. Unfortunately it did not work. I've tryied several times, but I do not know what I am doing wrong.
If you find out, please, let me know.
Regards,
Erick
Aug 31 2023 12:47 PM
You should use $AL15 in the formula instead of $AL$16,
If it still doesn't work:
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
Sep 04 2023 07:36 AM
@HansVogelaar, thank you again for your answer.
You were totally right. Now I know exactly how to do this.
Regards,
Erick
Aug 30 2023 03:29 PM
SolutionSelect B1:L1 (or more rows in columns B to L if you wish).
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=$A1="text1"
Click Format...
Activate the Fill tab.
Select green as highlight color.
Click OK, then click OK again.
Repeat these steps with the formula
=$A1="text2"
and red as fill color.