1

I am trying to create a conditional formatting rule for a table which looks up a pass mark in another table and then compares the value to that pass mark. It is meant to be as general as possible because columns will be added later.

My desired outcome is this:

Sheet 1 (Table2):

enter image description here

Sheet 2 (Table4):

enter image description here

The ticks show pass or fail.

Currently, to make this example for sheet1. I have the following in each cell: =XLOOKUP(INDEX(Table2[#Headers],COLUMN()-MIN(COLUMN(Table2))+1),Table4[[Name]:[Name]],Table4[[Pass Mark]:[Pass Mark]],"Exam name not found"). This clearly works because the correct numbers appear in each cell.

When I copy paste this into the formatting rule dialog, I get "Please enter a valid formula". Why? The applied area is the entire worksheet. formatting rule

Update: If I remove the Table syntax and use this formula =XLOOKUP(INDEX($1:$1,COLUMN()-1+1),'Pass Marks'!$A:$A,'Pass Marks'!$B:$B,"Exam name not found"), then it's no longer invalid. However, the ticks and crosses change seemingly at random when I add new data or change existing cell values!

excel file: https://file.io/HYIm2m8r875I

2
  • I can confirm that structured / table refs in CF does not work in O365. There are quite a few complaints about it online too but seemingly no official statement confirming or denying support. I suspect it has something to do with the way that CF deals with relative references that makes structured refs difficult to work with. As for using normal A1 refs, any chance the CF isn't working because the data is recognized as text? To test add a dummy column and enter the formula =ISNUMBER(D3) or convert to numbers on the fly with =D3+0. Oct 20, 2022 at 5:49
  • Also try this =XLOOKUP(C$1,'Pass Marks'!$A:$A,'Pass Marks'!$B:$B,0)+0 assuming you start your CF in cell C2. Make sure it is C$1 and not $C$1 or Excel won't update the relative reference correctly. Also the "not found" text return might cause errors for the numerical comparison so rather use 0 or whichever for your default condition. The +0 at the end helps to convert any "text" formatted numbers to actual numbers. Oct 20, 2022 at 6:01

0

You must log in to answer this question.