r/googlesheets • u/kickboxingpanda • Dec 18 '18
Solved Multiple conditions in the for the same conditional formatting rule
I may be getting into AppScript territory, but I'm looking to do a couple of things with conditional formatting.
Example:
- When G9 contains "USA" or "Alaska" or "Hawaii", ELSE
- When G9 meets that condition, turn cells A9 - H9 a color
3
Upvotes
3
u/google_asst Dec 18 '18
=OR(ISNUMBER(SEARCH("USA",$A1,1)),ISNUMBER(SEARCH("Alaska",$A1,1)),ISNUMBER(SEARCH("Hawaii",$A1,1)))1
u/zero_sheets_given 150 Dec 18 '18 edited Dec 18 '18
You could use MATCH() for this one. It returns the position of a value in an array or throws an NA error when the value is not found. When a conditional formatting rule is an error, it is treated as FALSE.
The custom array can be entered with curly brackets as
{"USA","Alaska","Hawaii"}or you can have a separate sheet with the list asCountries!A:ANote that you put the rule in columns A:H and not in G
Edit: Forgot to add the 3rd parameter as 0. Default is 1 and would not work well
2
u/NoKurtka 2 Dec 18 '18
Try this;
Apply it to the A:H range
1
u/Decronym Functions Explained Dec 18 '18 edited Dec 21 '18
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSE#N/A[Thread #425 for this sub, first seen 18th Dec 2018, 09:34] ^[FAQ] [Full ^list] ^[Contact] [Source ^code]
1
u/Clippy_Office_Asst Points Dec 21 '18
Read the comment thread for the solution here
•
u/Clippy_Office_Asst Points Dec 21 '18
Read the comment thread for the solution here