Forum Discussion
Conditional Formatting
Example A1:Z100
Go to Conditional formatting ->
Use a formula to determine which cell to format.
Enter the formula
=IF($A1="India",1,0)
In Format, select the required colour.
Do let me know if any clarification or further information is required.
Vijaykumar Shetye,
Spreadsheet Excellence,
Panaji, Goa, India
- vijaykumar shetyeMay 04, 2017Brass ContributorSelect the cells which you want to format.
Example A1:Z100
Go to Conditional formatting ->
Use a formula to determine which cell to format.
Enter the formula
=IF($A1="India",1,0)
In Format, select the required colour.
Repeat the same formula for other countries.
Only change the format colour.
Do let me know if any clarification or further information is required.
Vijaykumar Shetye,
Spreadsheet Excellence,
Panaji, Goa, India- David JamesMay 04, 2017Copper Contributor
THanks for your reply. Excel didn't like the IF statement. It seems it is not required.
Regards
- SergeiBaklanMay 04, 2017Diamond Contributor
David,
It's not required, but in general conditional formatting shall work with IF (i didn't test above particular formula). You may use in the rule any formula which returns TRUE or FALSE or their numeric equivalents. That's for "normal" formatting, not when you apply icons and like.
Another point, not to hardcode countries' names within the rules you may use helper column with countries name. Let say in AA:1 "India", in AA:2 "USA", etc.
When you have one rule for each color, rule formula will be like
=($A1=$AA$1)
If one day you'll decide to exchange colors for the countries, or change the country name ("USA" => "United States") you may simply make such changes in helper column without editing formatting rule. The only when you need to do that if to add new color which is not in existing rules. But even in this case you may add few dummy rules for future needs.
However, if your data is static one time hardcoding works fine.
- SergeiBaklanMay 04, 2017Diamond Contributor
Hi,
In Conditional Formatting rules it's enough to enter
=($A1="India")
The only point is to use relative reference for the column to expand formatting on entire row
- David JamesMay 04, 2017Copper ContributorThanks for this, it seems to be working.
It is a lot of formatting rules but it will be OK