ranges and conditional formatting on google spreadsheet - google-sheets

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

Related

Conditional Formatting formula to compare two cells when one cell has a delimiter

So I have in column D QtyInvoiced and in column G QtysSent. For each row, QtyInvoiced is a single number e.g. 50. QtysSent on the other hand is of the delimiter format A_B_C where A,B and C are quantities. In each case, A+B+C would be the Total QtysSent.
How can I write a conditional formatting formula that compares (in the example above), the single value 50 in column D to A+B+C and higlights both cells in the particular row if they are not equal?
I imagine it requires using SPLIT inside the formula but not sure how to construct it to tell Google Sheets to compare the sum after splitting to the value in column D and then highlight both if they are not equal.
try this out:
Custom formula:
=$D2<>SUM(SPLIT($G2,"_"))

Implement formula in a column based on contents of each cell

In my Google Sheet, I have 1000+ rows of Date entries. For each Date, I am calculating the Month# and Week# using MONTH() and WEEKDAY() functions respectively.
Here is the link to a sample file: https://docs.google.com/spreadsheets/d/1Af5-pYMFWZ1QtLoaAbPZYMGRvk43JBslUp4KyOFADfA/edit?usp=sharing
Problem Statement:
For all rows which have a unique Month# and Week#, I would like to implement a formula and calculate Output. For example, in my sheet, rows 3 to 6 pertain to Month=1 and Week=4. For this set of 5 rows I am calculating Output column as the subtraction from the first element in that set (ie... C3-$C$3, C4-$C$3, C5-$C$3 so on ). Similarly row 7 to 10 pertain to Month=1 and Week=5, and so I calculate Output
as Data-$C$7 and so on.
How do I implement this structure to calculate Output column on each set of unique Month# and Week# values?
Delete everything from Column F (including the F2 header). Then place the following formula into cell F2:
=ArrayFormula({"Output";IF(C3:C="",,IFERROR(C3:C-VLOOKUP(E3:E,{E3:E,C3:C},2,FALSE)))})
This one formula will create the header and return results for all valid rows.
Since VLOOKUP always finds only the first matching instance of what it is looking up, we can use it to ask that each value in C3:C subtract that first instance of where week-number match for each row.
By the way, although you didn't ask about this, you can also use this type of array formula in Columns D and E, instead of all of the individual formulas you have. To do that, delete everything from Columns D and E (including the headers). Then...
Place the following formula in D2:
=ArrayFormula({"Month #";IF(B3:B="",,MONTH(B3:B))})
... and the following formula in E2:
=ArrayFormula({"Week #";IF(B3:B="",,WEEKNUM(B3:B))})

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.

Complicated Conditional Formatting

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.

Google spreadsheets: conditional formatting with custom formula based on values from different sheet

I have a google spreadsheet with two sheets. On the first sheet, the items are listed in column A, and their types are in column B.
On the second sheet, I reference to the first sheet's column A with the formula: =UNIQUE(Sheet1!A:A).
Then I want to color the items in the 2nd sheet based on the item type (1st sheet's column B*). I try to add conditional formatting using the formula =Sheet1!$B:$B="Type1", but when I try to save rules, it says the formula is invalid.
What would be the correct formula for this case?
You cannot reference cells directly in the conditional format formula. Also, I do not think that formula would work.
First, you need the VLOOKUP function to get the object's type.
Here's an example of using this function. The difference would be that the corresponding data in the first parameter would be preceded by the sheet name in your case.
See this image:
As you can see, VLOOKUP searchs for the item from D in the matrix A2:B4, and then returns the corresponding value (the value in the same row) in the second column of the matrix, which is column B.
So if you to apply this formula to conditional formatting, you would have:
=VLOOKUP($D$2:$D;$A$2:$B$4;2)="Dragon"
The first parameter of VLOOKUP has to be a range, and I started it from D2 so it would not match the header. In your case, it would become:
=VLOOKUP($D$2:$D;Sheet1!$A$2:$B$4;2)="Dragon"
But as you cannot use references directly, you need to use the INDIRECT function. It receives a cell range as a string and returns a reference to that range. It's the same as using references directly, but in this case you add an extra step (go figure). So the formula finally becomes:
=VLOOKUP($D:$D;INDIRECT("$A$2:$B$4");2)="Dragon"
You can choose any range to apply the format if you are using the new version of Spreadsheets. You could, for example, color the entire row or just a single cell.

Resources