My approach to this is usually to use a selection change event to plug the details of the active cell into cells that will be on a hidden sheet. You can use something like the following for the table in Example 1:
You can then use the cells on your hidden sheet as easy references to create the conditional formatting rules that you're after. For instance, I used the following for the blue activecell highlight in the attachment:
=AND(ROW(A1)=HideMe!$B$1,COLUMN(A1)=HideMe!$B$2)
Craft the CF rules you want, hide the HideMe sheet, and you're good to go. For further details, take a look at the attachment, where I approximated your request for Example 1:
Bookmarks