Issue with conditional formatting cell range based on exact match text in one cell - google-sheets

We track workshop registrations in a google sheet and I'm trying to conditionally format a range of cells (A7:P14) based on the text in cell E7 (Eng DLO, Eng TBC, Sp DLO, Sp TBC).
I used the formula
=COUNTIF($E7:$E, "Eng DLO")
and A7:S14 turned the selected color (light purple). When I then added conditional formatting to turn dark purple with the formula
=COUNTIF($E7:$E, "Eng TBC")
the color wouldn't change when I changed the value in E7 from Eng DLO to Eng TBC.
I know the issue is that I need it to EXACTLY MATCH the text and I tried incorporating EXACT into the COUNTIF formula, but it would only highlight E7 or just A7:P7 instead of the whole selected range in the conditional format (A7:P14).
Here is a sample sheet with what I am hoping it will eventually look like once I get the conditional formatting to actually work (I removed the conditional formatting). https://docs.google.com/spreadsheets/d/1Bn9FVTHE1OO49p4PKo6j0Qd3c0NX6pUq3vp0pHFNGVI/edit?usp=sharing

Got a couple other issues here:
The 7 is a floating reference, so you need to fix it with $. This is the reason your formula isn't working. In the next row, it would start counting in cell E8. With the $, it works, but less efficiently than it could, which brings me to point 2.
If you're only referencing one cell, just check for equality against that one cell.
To the Eng TBC, you would use
=EXACT($E$7, "Eng TBC")
Just to demonstrate a point, without the dollar sign, the next rows cells would have been checking against this:
=EXACT($E8, "Eng TBC")
Which of course would have been empty.
A More Flexible Solution
Since you probably don't want to keep having to reformat per set of cells, you can use a ROW-based approach to tackle the issue. This one, for example, assumes 8 seats per group.
=EXACT("Eng DLO",INDIRECT("E"&(8 * INT((ROW() - 7) / 8) + 7)))
Every 8 rows, it references the next multiple of 7. (Yes, INT is FLOOR, but shorter.)

Related

I'm looking for a Google Sheet array function to add specific increments in each row

Here's how it looks.
Hi. I'll try to be as specific as possible about this :)
I'm making a Google Sheet page similarly to a game character progression, that will automatically fill up based on data from other sheets: specifically, these "EXP" bars fill up with values based on the hidden cell A5.
For instance, the cells from D5 to BA5 represent LV1.
As the function shows, every time the value in A5 reaches an even number (for LV1, it's all even numbers from 2 to 100), one of the slots will fill up with a number, that with conditional formatting, will change the color of the cell and make it look like an actual exp bar filling up.
I'm using the function =COUNTIF(A5,">=2") and manually changing it to ">=4", ">=6" etc until ">=100" for the first bar. The second bar will have its 50 cells with all even numbers from ">=102" to ">=200".
So, to get to the question: is there an array formula that facilitates the process of filling a great amount of these bars with functions, without changing them all manually? Even automating *some *of this process would be great. Besides it being tedious, it leaves a lot of room for human error.
Thank you in advance to whoever's got an answer.
P
I haven't tried much as at the moment I am very confused by the vast amount of options array formulas provide. I have 48h of experience in the matter.
I suggest you to use the values of columns and rows here as helpers to do calculations. If you know that every column adds 2 and every row adds 100 you can set a formula like this for the whole range (select the whole range and add just one rule of conditional formatting):
=$A$5>((Column(D5)-3)*2+(Row(D5)-5)*100))
You use $symbol to make A5 steady and D5 value will "move" to each cell for conditional formatting, so you don't have to make an ARRAYFORMULA for this

Google Sheets - Combining COUNTBACKGROUNDCOLOR and COUNTIF formulas

I want to count the amount a certain text(aus) appears in a column, but I only want to search the rows that have one specific color. I have the two seperate working formulas but haven't been able to combine them succesfully yet. Anybody an idea how to do this :) ? Here are the 2 formulas i have:
=COUNTBACKGROUNDCOLOR("J2:J361";"A2")
=COUNTIF(J2:J361; "*aus")
It appears as though you are using a script to implement your own function of COUNTBACKGROUNDCOLOR(). If this is the case you cannot combine the two functions as it stands since it is a user defined function. As MattKing pointed out maybe count the cells with your data AND the method used to declare the color (checkboxes). Example:
Conditional formatting applied to cells that highlight the cell green if adjacent checkbox is TRUE.
Formula used
Notice the answer is 2 and not 3 because from your formula you are only looking for wildcards before "aus" and Cell D4 contains a "?" at the END ("what is aus?")

Excel/Sheets Formula for "If addition of two times is between 00:00 and 7 am display time in red, if not display time in black"

I'm trying to reference multiple time additions and subtractions. Essentially I've got Cell A that is a date and time and constantly changing and Cell B that is a time that changes too. Then Cell C that displays Cell A + Cell B. I want to make if Cell C is a time between midnight and 7 am display the time in Red font. If not display the time in Black font.
Here is an example Sheet https://docs.google.com/spreadsheets/d/1Qjr2JzC42z3sxqH7Rz4BSMsAMv1LIAZH3gES9fYeY0g/edit?usp=sharing . The date and times on the left must add a time on the right, but then also check to see if its a specific time (date doesn't matter) and if it's between 00:00 and 7:00 then show the specific date and time in red otherwise black. I think the answer may have something to do with conditional rules and I found this article indicating changing font colors in excel but the formula comparing specific times I'm stuck on.
I've tried to make an example formula in a cell without conditional rules to check to see if I can make it work by doing =IF(AND(C5>=MIN(P5:P47),C5<=MAX(P5:P47)),"YES","NO") but thats not working. I also came across this formula which may help =AND(val>MIN(NUM1,NUM2),val<MAX(NUM1,NUM2)) but am unsure at this point.
---EDIT---
Figured it out using a conditional format =AND(HOUR($C5)>=0,HOUR($C5)<=7)
I actually just Figured it out with Conditional Format =AND(HOUR($C5)>=0,HOUR($C5)<=7)
Add A1 and B1 in C1 and then use Conditional formatting with a custom formula in C1.
=TIME(HOUR(C1), MINUTE(C1), SECOND(C1))<0.29
You can choose the custom format to be a red font.
try:
=TIMEVALUE(C1)<=TIMEVALUE("7:00:00")

Multiple Layers of Matching Blank Cells

I'm back with another Google Sheets question. This one isn't scripting though - this time I'm looking for help in figuring out a formula.
I've attached screenshots of two sheets. The first one features one "opposing party" at row 8. The second one features an opposing part at row 8 and a second opposing party at row 9. Cell B3's formula is shown in both; in essence, Cell B3 looks for the first blank cell in column L after Row 10 (or Row 11 in the second image) and returns the contents of that row's "F" column. This allows me to "get" the next deadline in the matter that is being tracked. For those interested, yes, Cell D3 has a similar formula looking at K.
Currently, we have to manually update B3 (and D3) if we add additional parties (not necessarily opposing, and not just one either). This is more tedious than I would like. I would like a formula that would return "F10" and "L10" in situations where only one opposing party appears, "F11" and "L11" if there is an additional, and so on so that even if we have a massive, multi-party action it will still return the next cell.
If it helps, you can always assume that there will be a blank set of cells below the last "opposing party" and the row that we want to start querying (as shown in the second image).
I'd love any help that you can give. Please let me know if you need anything clarified.
Thanks a ton!
--Databoy2k
Is this what you require for B3?
=index(F:F, match("rule", I:I, 0)+1)
In a larger scope use,
=index(indirect("F"&match("Rule",I:I,0)&":F"), match(TRUE, index(isblank(indirect("L"&match("Rule",I:I,0)&":L")),0,0),0))
I think the easiest way would be to make the cells you are referencing a named range. That way, you can add as many other rows, columns, cells, whatever, and your formula will always reference the same range of cells.
For example, you could name the range of cells in column F 'Steps', and in K 'Deadline', then change your formula to =index(Steps,match(TRUE, index(isblank(Deadline),0,0),0)), and it will always give you the correct range.
Here's a pic to show how to name a range (right-click on the selection).

Change the background of one google sheets column based on the date in another column

I've seen lots of answers for various other conditions under which to do this. However I can't seem to modify any of these to work for a date range. What I want is for the column color of column E to change if the date in column H is between today and 5 days from today.
I've tried varying versions of this formula: H3:H150 =today() +5 with no success
This doesn't give me the range of between now and 5 days from now but I could do multiple rules like this and just go down on each one(=today() +4, =today() +3, etc) but obviously I need this rule to work first.
Thanks!
Conditional formatting is more helpful than you seem to be expecting. Clear formatting from the column to be formatted, select it and Format, Conditional formatting..., Format cells if... Custom formula is and:
=and(H1>today(),H1<today()+6,H1<>"")
Then select fill of choice and Done.
This should format the next five days (change the angled brackets around for the past five days).
Setting the range is achieved with selection of the column to be formatted (not the one with dates in it - H). If only to apply to Rows3:150 (and in general it is a good idea, for speed of processing, to restrict the ranges to which CF is applied) then either start by selecting Rows3:150 in the column to be formatted (instead of the entire column) or adjust the Apply to range for the rule, but in either case use H3 in place of H1 in the formula above.
CF should automatically apply the rule as written to the first row in the selected range and then adjust it for the second and subsequent rows in the way copying down would adjust the formula (if at all) were it in a cell in the sheet.

Resources