Check multiple true condition in multiple cells - google-sheets

Is there any built-in function to check if there's multiple TRUE condition ? Like
OR() but can detect if there's more than 1 TRUE. For example :
i use this conditional formatting (custom formula) in cell A3:
=OR(not(isblank(B3)), not(isblank(C3)) , not(isblank(D3)), not(isblank(E3)) )
so background color of A3 will become RED if any of those cells (B3,c3,d3,e3) is not blank. But i want it to become RED only if 2 or more cells is not blank. This is to give me warning if there's duplication . I only want 1 cells to be not blank. iF there 2 or more, i want the A3 to be RED so i know there's duplication.

yes you can do:
=(B15=A15)+(C15=A15)+(D15=A15)>1

Related

Change cell value based on checkbox in Google sheets

I'm using Google sheet to manage my budget (see sample below) where I add each of my expenses as a single entry (yes, sounds like a lot of work). I sometimes split the expense with my roommate but then I have to add the value and divide by 2 everytime.
I was thinking if I could use a checkbox next to the value that will automatically divide the expense number by 2 when I check it. Is this possible?
I'm open to simple suggestions other than the checkbox to automatically update the value. Thank you.
Using simple IF formula you can just check if the checkbox is true, if it is then it will divide the current value on column C by 2. Otherwise it will remain blank.
Formula:
=IF(D1,C1/2,"")
Drag down to other cells.
Result:
Suggestion, Alternate solution:
If you'd like you can make a table with a column for your roommate, instead of editing the actual column so you can see both values. And use this formula:
=if(NOT(D2=""),E2/2,E2)
You have a column for per head contribution/split. If the cell on roommate is blank then it will stay as the total value, if roommate has an additional then it will be added to total and split it by 2.
Or using arrayformula:
=arrayformula(if(NOT(D2:D=""),E2:E/2,E2:E))
Works the same as above you just have to fill the enter the formula in the first cell no need to drag down and it will automatically expand to rows/cells below just make sure that below cells are empty or it will return an error.
Additional - Using same cell
As you've mentioned in the comments. Here's a way to divide the original value without using another cell to store it. (Not recommended)
Formula:
=VALUE/IF(D1,2,1)
example:
=1000/IF(D1,2,1)
Result:
However, I do not recommend this. It is still best to make use of another cell to store the original value before making calculations to it.
Also, using this formula you have to change the value from the formula and not on the cell otherwise you will replace the actual formula.
You can try array approach-
=ArrayFormula(IF(D1:D,C1:C/2,C1:C))

How do I stop the cell fill colors from being revealed on Google Sheets before Conditional Formatting takes effect?

I have a sheet with a set of cells filled in various colors. I currently have conditional formatting set up to cover my background colors with white unless the specific condition is met where two cells match. I'm using the custom conditional format rule: =$Y$7<>$B$2 and the range is a different group of cells. Everything seems to work except when the first item is entered, all of the background colors flash for a couple of seconds and the Sheet freezes before the cells are covered with white as expected. Then it works normally. I would love to find a way to NOT have the background colors shown until the conditions are met.
you can add one more condition:
=($Y$7<>$B$2)*($Y$7<>"")*($B$2<>"")

Google Sheets: Conditionally Shade an Individual Set of Repeating Groups of Cells Based on Value

I have a Google Sheet I use to document my quotes for customers. I've copied and pasted it down the sheet several times. Within each quote is a list validated field where the options are "Won" or "Lost." When I select "Won," I want to turn that background color of JUST that quote green. However, I also only want to shade green the fields that I am not entering text into or accomplishing the calculations on (the data fields); I want to shade the background of the "form" and the "labels." (See screenshot where I did this by hand.)
I've attempted do this myself, but I'm having two issues.
I have to create separate conditional format rules for each quote/group of cells. This is tedious. I'd like, if possible, to create one rule that is able to adapt the conditional test of ="Won" to each group/quote separately.
I have to individually select each and every cell to be highlighted because if I just do A1:G33, all of the cells change color, even the ones in black and gray. I know this is expected, but is there a way around it?
I'm confused why applying the rule to the first group and copying and pasting it doesn't work. All of the quotes change green if the first quote shows "Won." This functionality works correctly with the built-in conditions that test the value of the cell itself. However, custom formulas to test the value of another cell don't "repeat" and operate individually it seems.
EDIT: Link to spreadsheet: https://docs.google.com/spreadsheets/d/1OH16NXLiRzY3-EdZaxmUl5Vp6cQNPzY-_-LV7VIDl8U/edit#gid=983650786
in your case perhaps best would be to color the first table exactly as you wish and then select it, copy it, select the first cell of the next table and:
Use Apps Script
This way you can have a lot of flexibility and its easier to manage.
You seem to already have an onEdit trigger, so you could integrate some more logic into that to test for statues. I can't implement everything you want but this should get you well on the way.
function onEdit(e){
// Getting the information on the edited cell
let editedCell = e.range;
let sheet = editedCell.getSheet()
// If the edited cell is in column 6, in "Quotes" and is value "Won"
if (editedCell.getColumn() == 6 && sheet.getName() == "Quotes" && editedCell.getValue() == "Won") {
// Get the row to know where to change the format
let statusRow = editedCell.getRow();
// Get the range of the whole form
let formRange = sheet.getRange(statusRow, 3, 17, 6)
// Set the background color
formRange.setBackground("green")
}
}
Hopefully you can see how you might extend this to include other ranges. You would need to base everything of the position of the edited cell. I have identified it by its column, the sheet that contains it, and its value. You can extend this to include checks on the value next to it for example. Then to change the color of each black box, you would need to define a range for each, relative to the edited cell.
References
setBackgroundColor
getRange

Conditional formatting depending on checkbox

What I want to happen:
Depending on whether a tick box is clicked or not the corresponding cell on the same row should be colored (box unchecked) - so it would look like this:
My best guess was doing the following:
to color a whole row you need to freeze the column with $
=$G2=FALSE
applied to range A2:Z

Can you set up conditional formatting based on colors of other cells?

I'm a projectionist at a movie theater, and we have a spreadsheet to track all of our content chronologically. Each show has its own row, complete with all of the details regarding time, theater number, format (digital DCP, Blu-ray, 35mm, etc).
We use this to verify at-a-glance where we're at on managing the content to make sure everything is set up to go. I have conditional formatting set up in every cell so that if it's a Yes or - (meaning not applicable to that show) it turns green, and if it's a No or ? (meaning we haven't gotten that information yet) it turns red.
What I want to know is if it's possible to have another column specifically for an overall "Yes" or "No", based automatically on the contents of the rest of the row (for example, column "D" will be green for yes and red for no). So if a show has all of its criteria met for the rest of the row (E* through Z*), manually filled out to turn green, that one cell (D*) will automatically follow suit. If something is missing from the rest of the row and contains even one red cell (anywhere in E* through Z*), that one cell (D*) will stay red as well.
I realize it probably needs a bit of scripting involved for this, which is not within my realm of experience, but I'm not even sure if it's possible. A lot of the spreadsheet is inputted manually, so one more column with a manual cell isn't the most inconvenient, but if we could set it up to be automatic, that would be incredible.
To branch off my comment above:
Additionally, have the cells by default set to red (using the fill option). If any of the cells are "NO", the condition won't be met, and it'll show as red:
Using OR:
=AND(OR(A1="YES",A1="-"),OR(B1="YES",B1="-"),OR(C1="YES",C1="-"))

Resources