Forum Discussion
Index Match Conditional formatting
To apply conditional formatting using Index Match in Excel, you can follow these steps:
- Select the range of cells that you want to format in Table 1.
- Go to the "Home" tab in the Excel ribbon.
- Click on the "Conditional Formatting" button.
- From the drop-down menu, select "New Rule."
- In the "New Formatting Rule" dialog box, select "Use a formula to determine which cells to format."
- In the "Format values where this formula is true" field, enter the following formula:
=INDEX(Table2, MATCH($A1, Table2[Employee ID], 0), MATCH(B$1, Table2[#Headers], 0))<>""
Note:
- Replace "Table2" with the actual range reference of your holiday table.
- Adjust the range references ($A1 and B$1) according to the location of the first cell in your selected range.
- Click on the "Format" button to choose the formatting style for the cells that meet the condition.
- Click "OK" to apply the conditional formatting rule.
This formula uses the INDEX and MATCH functions together. It looks up the Employee ID in Table 1 and matches it with the Employee ID column in Table 2. Then it matches the date in Table 1 with the column headers in Table 2. If there is a match and the corresponding cell in Table 2 is not empty, the conditional formatting will be applied to the cell in Table 1.
Make sure to adjust the range references and table names in the formula to match your specific setup. The text was created with the help of AI.
Hope this will help you.
- kbloggs21Jun 29, 2023Copper Contributor
NikolinoDE the formula unfortunately did not work
- NikolinoDEJun 29, 2023Gold Contributor
Maybe you can consider using the IF function to combine the conditions and apply the conditional formatting. Here is an example of how the formula could be structured using the IF function:
=IF(AND(MATCH('Forecast Data (Current) - HOL'!$E161, 'Leave Chart - Weekly - Auto'!$A$1:$A$293, 0),
MATCH('Forecast Data (Current) - HOL'!DF$8, Table_Leave_Chart___Weekly___Auto[[#Headers],[01/07/2023]:[30/12/2023]], 0)),
INDEX('Leave Chart - Weekly - Auto'!$I$1:$AI$293,
MATCH('Forecast Data (Current) - HOL'!$E161, 'Leave Chart - Weekly - Auto'!$A$1:$A$293, 0),
MATCH('Forecast Data (Current) - HOL'!DF$8, Table_Leave_Chart___Weekly___Auto[[#Headers],[01/07/2023]:[30/12/2023]], 0))>8,
FALSE)
This formula combines the two conditions using the AND function and returns TRUE if both conditions are met. Otherwise, it returns FALSE. You can apply conditional formatting based on the TRUE/FALSE values. Text and formula based on AI processing.
I hope these suggestions help you troubleshoot the issue with your conditional formatting formula.
- kbloggs21Jun 29, 2023Copper ContributorThanks, the conditional format says enter a valid formula -
below is the formula -
IF( AND( MATCH($E145, 'Leave Chart - Weekly - Auto'!$A$2:$A$293, 0), MATCH('Forecast Data (Current)'!DB$8, Table_Leave_Chart___Weekly___Auto[[#Headers],[01/07/2023]:[30/12/2023]], 0), INDEX('Leave Chart - Weekly - Auto'!$A$2:$A$293, MATCH('Forecast Data (Current)'!$E145, 'Leave Chart - Weekly - Auto'!$A$2:$A$293, 0), MATCH('Forecast Data (Current)'!DB$8, Table_Leave_Chart___Weekly___Auto[[#Headers],[01/07/2023]:[30/12/2023]], 0)) ) > 8, TRUE, FALSE )