Forum Discussion
Conditional Formatting Based on a Table
You can use a combination of formulas and conditional formatting rules to achieve the desired result.
Here is a summary of the steps:
Select the range of cells (the grey squares) that you want to apply the conditional formatting to.
Go to the "Home" tab in the Excel ribbon and click on "Conditional Formatting" in the "Styles" group.
From the dropdown menu, select "New Rule" to open the "New Formatting Rule" dialog box.
In the dialog box, select the option "Use a formula to determine which cells to format".
In the "Format values where this formula is true" field, enter the following formula:
=IF(INDEX(Table1,MATCH($A$1,Table1[Code],0),MATCH($B2,Table1[#Headers],0))="M",TRUE,FALSE)
Note: Adjust the formula according to your specific table range and cell references.
Click on the "Format" button and choose the desired formatting style for the cells (e.g., red fill color for M, white fill color for F).
Click "OK" to close the dialog box.
Please note that there may be slight differences in the user interface or menu options between Excel versions, but the general concept of conditional formatting based on a formula remains the same. By using this approach, you can dynamically apply the formatting based on the values in the table, without the need for external code or languages like HTML/JS/CSS.
The text and formulas was created with the help of AI.
Hope this will help you.
So, I tried the formula with my details and I keep getting an error message.This is what I've put in
=IF(INDEX(Table110,MATCH($AF$3,Table110[Code],0),MATCH($AH4,Table110[#Headers],0))="M",TRUE,FALSE)
I have also tried it with [Code] b4eing my range of cells for the table and it still doesn't work. Have tried a number of changes to the $AF3/$AH$4 parts none of which are working.
Any idea what I've done wrong?
Thanks