简体   繁体   中英

Adding Text into a cell based on colour of another cell

Is it possible to a add text to one cell based on another cell colour

IE:

If A1 is Green A2 is "Yes" If A1 is Red A2 is "No"

There are several things slightly off with this question.

  • Conditional formatting, as the name implies, is used to format a cell, not to place a text like "yes" in a cell.
  • Color is not data. Color cannot easily be used to feed values into formulas.
  • conditional formatting can easily be used to turn a cell green if another cell has the value "yes". That's what it's made for. Doing it the other way round is way more complex.

You may want to edit your question and supply some more detail about what you want to achieve without focusing on a particular technique like conditional formatting.

Edit after question was edited:

The architecture is still backwards. What caused the cell to become green?

Instead of changing the color of A1, write "yes" into A2. Then use conditional formatting to turn A1 green based on the value of A2.

Try working with Excel instead of against it.

Refer to https://stackoverflow.com/a/24383150/4209849 and https://stackoverflow.com/a/15888583/4209849

You can add different text depend on the cell by its side with different colors . And you can imaging more.

What I would like to add is. Even if the color is not within the limitation that the provided answer above could recognize. There is a simple way to use "Find/Replace" in excel to batch replace the original color to a more common color then do the trick.

For me, I want to replace the colored cell with text and then do math on it (count it for example). And "Find/Replace" is working like a charm.

Maybe it is helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM