Complicated Conditional Formatting - google-sheets

I am new to formulas and conditional formatting.
I have a spreadsheet where employees submit requests for adjustments to their time worked. Column B is the date of the request, Column C is their username, and Column H is the reason. I want to create a conditional formatting formula to check if the there are any duplicates, so essentially,
Highlight row 2 if: value in B2 exists anywhere else in column B, AND value in C2 exists anywhere else in column C, AND value in H2 exists anywhere else in column H).
And I need this to work for every row.

You will need a helper column for that. Use a formula like this to concatenate the values of Date, Name, Reason and Notes, for example in cell L2 and copied down.
=A2&B2&G2&H2
Now you can apply conditional formatting to the range A2 to H2 using the custom formula
=countif($L:$L,$L2)>1
You can hide the helper column if it upsets your spreadsheet design.

Related

Is there any formula to select the column dynamically in the below case?

Refer the worksheet here - https://docs.google.com/spreadsheets/d/1g3mthqijmB7lySfKUvt2NjYT-zVA5oyXr1hJKcJZkdc - Feel fee to edit.
I'm currently trying to get data from a specific column each time the data validation is changed.. It should pull the Names corresponding to FALSE values.. Currently I'm achieving this using multiple IF functions.. If there is a way to directly match the validation input to the row header and then get the values, it would be super great.
See my duplicate sheet ("Erik Help"):
=FILTER(E2:E,FILTER(F2:J,F1:J1=B2)=FALSE)
In plain English, this reads as follows: "Return any names in Column E where the header in in Columns F to J matches the value in cell B2 and where the corresponding value for the name is FALSE."
This formula is written flexibly, assuming that you will have more than two names in Column E within your real sheet. If there are more columns, just extend both instances of J to match the new rightmost column.

How to invert INDEX formula in Google sheets

I have a sheet named NYSEDB with stock names in column A and the companies that issued them in column B.
In another sheet I have companies in cells B2 and C2 (for example, AAPL, GOOGL etc.).
I have the following formula:
=ArrayFormula(IFERROR(INDEX(NYSEDB!$A:$B,SMALL(IF(NYSEDB!$B:$B={$B$2,$C$2},ROW(NYSEDB!$A:$A)),ROW(1:1)),1,1),""))
This formula, when I spread it down the sheet, returns all the stocks from NYSEDB that are issued by the companies I have specified in B2 and C2.
How can I make the exact opposite formula and "invert" the task - I want for the formula to show all stocks from NYSEDB WITHOUT those issued by the companies I have specified in B2 and C2.
Solution
Use the not equal operand <> instead of the equal one =.
In this case It's better to use the QUERY function. Which is effectively more expressive than an IF statement and makes exclusion straightforward using an array of exceptions.
Your formula will be then like:
=QUERY(NYSEDB!A:B, "select A where B<>'"&TEXTJOIN("' and B<>'", TRUE, B2:C2)&"'", -1)
Note: you can add as many exceptions as you want, but you will have to edit the B2:C2 range in the QUERY formula.
In this way the Query function will return the column A value whenever the column B value is not included in the exception row.
Reference
QUERY Formula

Google-spreadsheet: Error when trying to highlight all rows where values in Columns A and C are duplicates

I put the Conditional Formatting "=AND(COUNTIF(A:A,A1)>1,COUNTIF(C:C,C1)>1)" on columns A through C.
I did this with the goal of highlighting all rows where both the value in Column A and the Value in Column C are identical to another row in the spreadsheet.
What is wrong with my logic, and why doesn't it work?
It highlights things without any pattern that I can discern.
Base the CFR on,
=AND(COUNTIFS(A:A, A1, C:C, C1)>1)
Your formula didn't work because it was saying If A1 is in any row in column A more than once and C1 is in any row in column C more than once then true. In short, there was no commitment to the duplicates being in the same row.
Before you ask about the AND in a comment, it's just my formula writing style. The formula returns the same result without the AND(...) wrapper.
Different interpretation. Insert a new ColumnA and enter in A1:
=ArrayFormula(B1:B&"|"&D1:D)
Select all cells, clear any existing CF rules and Format - Conditional formatting..., Custom formula is and:
=countif($A:$A,$A1)>1
Select formatting of choice and Done.

ranges and conditional formatting on google spreadsheet

I need to apply a conditional formatting on a range of cells (more rows and more columns).
The condition must be a compare among the value contained in the cells and the value of another range (single column).
An example in the spreadsheet linked below:
https://docs.google.com/spreadsheets/d/1aS9iLkPycb0ABfv3pk8HX9JVS2SmdTJ76Bd5KO_P-gI/edit?usp=sharing
I have done it with a conditional formatting rule for each column (n columns => n rules).
I have use a custom formula like this:
=A:A>F:F
it compare the value of the cell #i of the column A with the value of the cell #i of the column F.
I tried to write a single formula that cover all the condition without a positive result.
exist a method to do it with one single rule?
Try selecting range A2:E13 from your example and using this formula:
=A:A>$G:$G
Dollar sign $ freezes column G:G → $G:$G, and each cell from range is compared with cell from column G

How do I conditionally format a cell in Google Sheets based on matching values in 2 other columns?

So here is what I am trying to do. I have a value in C1 let's say. I would like to like to highlight that cell if:
The value in B1 exists somewhere else in Column B(I'll call it Bn)
The values for A1 and An in this other row also match
So if B1 is 12:00 and A1 is Foo I want to highlight C1 if a cell(Bn) in Column B is 12:00 and the value of An is Foo.
Make sense?
1.Click the Format menu and select Conditional formatting....
2.Switch to the "Custom formula" option in the drop-down menu.
3.Add in the relevant formula, rules, and cell range.
Formula:
=AND(COUNTIF(A:A,A1)>1,COUNTIF(B:B,B1)>1)
Cell Range: $C - The entire C column
4.Click Save rules.

Resources