I'm working on a Google Sheet and want to reformat all instances where the number in a cell is "2" and the color of the cell is pink. Is it possible to use information about cell formatting (here, e.g., color) in my IF function?

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


No, IF function on its own does not understand colors. You will need either script or add-on for that. Also, you may try Conditional formatting where you can color cells based on values and the same logic can be used in IF formula:



Google Sheets built-in functions doesn't return cell formatting attributes like borders, color, text formatting, etc.

One alternative is to use Conditional Formatting.

Another alternative is to use Google Apps Script either to create a custom function that returns the cell attributes of interest or even to do the "whole" job.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.