how should I write this: IF(AND(B2='sCHOOLbOOKING', E2 cELL COLOUR = 237 125 49),…
- User
how should I write this: IF(AND(B2='sCHOOLbOOKING', E2 cELL COLOUR = 237 125 49), "STOP", "")
- Assistant
You can write the formula as:
=IF(AND(B2="sCHOOLbOOKING", E2CELLCOLOR=23712549), "STOP", "")
Note: Make sure to adjust the range and format of the cell color check according to your spreadsheet program's capabilities. The current format "E2CELLCOLOR" is just a placeholder.
- User
I am trying to write that if the background colour of E2 is RGB 237 125 49
- Assistant
In that case, you can refer to the background color of cell E2 by using the formula:
=IF(AND(B2="sCHOOLbOOKING", R2=237, G2=125, B2=49), "STOP", "")
Note: Replace R2, G2, and B2 with the respective cell references of the red, green, and blue color values of cell E2.
- User
The background colour of E2 is #ED7D31 which is also RGB value of 23712549. I want to identify this in the If statement
- Assistant
Apologies for the confusion. To check the RGB color value of a cell in Excel, you can use the following formula:
=IF(AND(B2="sCHOOLbOOKING", HEX2DEC(MID(TEXT(E2,"@"),2,2))=237, HEX2DEC(MID(TEXT(E2,"@"),4,2))=125, HEX2DEC(MID(TEXT(E2,"@"),6,2))=49), "STOP", "")
This formula converts the hexadecimal color code (like #ED7D31) to the equivalent decimal RGB values for comparison in the IF statement.
- User
what is the correct way of writing this if statement: =IF(AND(E2),GREEN(E2))=23712549)), "Correct", "")
- Assistant
The correct way of writing the if statement is:
=IF(AND(E2)=237), (GREEN(E2)=49)), "Correct", "")