Google Sheets - Combining COUNTBACKGROUNDCOLOR and COUNTIF formulas - google-sheets

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?")

Related

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

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.)

Highlight Duplicates in Google Sheets

There are a couple questions here on SO that are related to this, but do not help to find the answer to the question.
I have a worksheet. Columns B3:R11 all contain names. Within this range, I want to change the color of the test or highlight the cell of the duplicated names. A simple google search returns several small variations of =COUNTIF(A:A, A1)>1 conditional formatting. I have tried several ways to modify this custom formula to make it work but just can't seem to get it right.
Logically, I would think it needs to be =COUNTIF(B3:R11, B3)>1 but that does not work either. It seems to just format random sells within the range.
How can I achieve the goal of marking duplicated cell content?
I was able to solve this problem after realizing that the conditional formating custom formula could have possibly also been iterating on not just B3 but also the range specified B3:R11 in the countif. By adjusting the formula to =COUNTIF($B3:$R11, B3)>1 so that the range was not iterated on, I was able to achieve the results I needed.

In Google Sheets, How do I find the row number of a cell with certain text in it?

In Google Sheets, What do I do if I want a cell to display the row number in which a certain word/line of text appears?
So, I'm working with two kinds of spreadsheets here: One has the number of "Competitors" (which I'm looking for) in the 7th row of the spreadsheet, while others might have it in a different row. To work around this inconsistency, I want to set up a cell function which outputs the row number of where ever the "Competitors" number is, and then concatenate that function into a reference for the correct row-number.
The tables that I'm looking in all have the labels in the first column
Here are some viewable links to the Sheets I'm working on:
https://docs.google.com/spreadsheets/d/1SS_Bk2FFGNnsxhhg3RQGflTSxEncAjD-CaQBtPjTIVM/edit?usp=sharing
https://docs.google.com/spreadsheets/d/1JJvbiYUYT3zb8OFwHoF1WaLmEGkwO4N7lLLeBqgWRcw/edit?usp=sharing
^Notice how "Competitors" is in row 7 in one sheet but in row 6 in the other. This is why I need to find a function which can find a reference to the row number of "Competitors"
Figured it out - To find the row numbers that the string "Competitors" was in, All I had to do was use the MATCH function like this:
=MATCH("Competitors", A:A,0)
The user #Jeeped told me about the "Match" function in a comment under his answer. Although Jeeped's answer did demonstrate the "MATCH" function, he presented it being used along side the "SUM" function, which confused me at first. Give thanks/upvotes to Jeeped for helping me find the solution in this :)

How to use arrayformula to dynamically join strings in google spreadsheet?

I use Arrayformula() to make my reports dynamic and easier to edit. For example, if I have a Column A with a list o number o blue balls in a set and a Column B with a list red balls in a set, on the cell C1 I can write =ArrayFormula(add(A1:A,B1:B)) and in the Column C will have the total of balls in each set. It would be exactly the same as writing =A1+B1 in cell C1 and dragging the formula down to the last row. Arrayformula() has some benefits, because it will work if some adds or removes rows from the sheet and also it makes the reports way more organized and easier to edit.
Since I´ve discovered arrayformula(), my life has changed, because of the fact that googleSheets expands the formula to other cells. It does not work every time, but the idea of expanding to other cells seems to be possible some way or another, here is a good example of a problem that was not resolved by arrayformula(), but has the same idea.
Keeping that idea in mind, imagine that on Column A there is a list of First Names and on Column B there is a list of Last names. On Column C I want to join this two string using a simples space. The way to do that would be in the cell C1 write =join(" ",A1,B1) and then drag down this formula. This method method however is prone to error since people can add and remove rows, deleting my formula. I want to use a formula that I can write in one single cell and it expands to other cells. I´ve tried =arrayformula(join(" ",A1:A,B1:B)), but it does not work.
Is that a way to do that using =arrayformula() or other native function?
I know I could write a script or custom formula to do that, but this is not my goal here.
I think this formula should work:
=arrayformula(A1:A&" "&B1:B)
In case you want to use a delimiter, you can do the following to have a clean result even though, A or B is not present in some cases:
ARRAYFORMULA(ifna(ifs(isblank(A1:A),,ISBLANK(B1:B),A1:A),A1:A&" - "&B1:B))

Google Sheets Conditional Formatting based on two cells

I have a sheet where I would like to turn a row a color based on the value of two cells. I already have conditional formatting based on one cell of the cells I want to use for the two cell formatting.
I am using =AND($J:$J="Cancel",$L:$L="Yes") for the two cell formatting but it doesnt seem to work. Not sure if the first one =$J:$J="Cancel" is negating the formatting of the other or if if my formula is just bad.
Any advice would be appreciated.
if the trick is that you want the whole row to be colored that way, then all you need to modify is the "range" to apply it too, so you enter something like the start column and then just give it a row number as the second half of the range, without the column argument: A1:10001
That exact formula you listed =AND($J:$J="Cancel",$L:$L="Yes") worked for me when using the "custom formula" option:

Resources