Forum Discussion
Conditional Formatting with formula
- Jul 30, 2025
depending on where you live / local setting you may need to use ; instead of , so it might be:
=AND(LEFT($A1;2)="2G"; $C1="KIMBERLEY")
as for 'hard coding' you can use a table on this or another sheet to help define the possible combinations and something like:
=AND(ISNUMBER(XMATCH(LEFT($A1;2); TABLE1[codes])); ISNUMBER(XMATCH($C1; TABLE1[cities])))
In addition to coming back with the clarifications that m_tarler​ has requested, I would suggest that you try to avoid what's called "hard coded values" in your formula. In the formula you've asked about the "2G" and "KIMBERLEY" are both instances of hard coded values. The formula will only work when those specific values are present, which means that any alternate circumstances or conditions will have to have their own distinct "hard-coded" values. See this link for a good summary of the pros and cons of hard-coded values, the times when they're helpful, but also the warnings about inappropriate use.