How to Apply Conditional Formatting based on other sheet value - google-sheets

I have a sheet with data, in Sheet1 I have data in column M (Text data value "Done") so now I try to apply Conditional Formatting on my Sheet2 column K2:K if Sheet1 Column M have value "Done".
I tried this formula:
=Search("Done",indirect("Sheet1!M2:M"),0)
also this one:
=search("Done",Sheet1!$M2:$M)
but not working

Assuming that you don't want to highlight the entire column but just on a line-by-line basis, could you try with the following formula :
=INDIRECT("Sheet1!"&CELL("address",M1))="Done"
It worked for me when applying this as a conditional formatting rule in column K of sheet 2 and adding manually-created sample data in column K of sheet 1.
You might also want to check this if you were expecting another behaviour :
Conditional Formatting from another sheet

if your Sheet1 looks like this:
then all you need is:
=INDIRECT("Sheet1!M2:M")="Done"
spreadsheet demo

Related

To identify same words in two tabs in a google sheet

My Query is i want to highlight the duplicates in the two tabs in a sheet. My sheet is attached along with this question. In that "Sheet A" & "Sheet B" have common names in it i want to color it for the duplicates.
Sheet : https://docs.google.com/spreadsheets/d/1hL64Q7REorVkjJNKAEGPFBdinlIn8VwnE6H7L9fYB2c/edit#gid=0
If it is possible, is there any option to find the duplicates between two google sheets ?
if yes then pls help me to find duplicates in Sheet A in Match 1 sheet and Sheet C in Match 2 Sheet.
Sheet 2 : https://docs.google.com/spreadsheets/d/1xAUmvmaZPvfJwCHD_esrshLccgKM3VmP1CI46mMoRB8/edit#gid=0
I have an answer that shows how this can be done. See the tab I added, "Sheet 1-GK", into your sheet.
The formula in C1 looks at the data from Sheet 2 to see whether each name in Sheet 1 column A is found in Sheet 2.
Here is the primary formula:
=ARRAYFORMULA(IFERROR(
IF(MATCH(A2:A9,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1xAUmvmaZPvfJwCHD_esrshLccgKM3VmP1CI46mMoRB8/edit","'SHEET C'!A$2:A$8"),0),
"Y",
"N"),
"N"))
In the sheet, I have wrapped it in an array, {...}, to also add the column header text.
Then a conditional formatting rule is used to highlight the rows that have "Y" in column C.
Note that you can either hide column C, or incorporate its formula logic into the conditional formating rule, to do everything there.
Is this what you were looking for, or did you need something else?

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

Conditional Matching in Google Sheets

I have two spreadsheets. Each has a column A that has an account number. But each has a different info about that account. The accounts also don't share the same set there maybe some the other doesn't have. What I want to do is check Sheet one column A vs sheet two column A and based on that populate a cell in Sheet 1 with Sheet two column B. Could anybody help me with how I might do this.
My Sheet2 looks like this:
You can use VLOOKUP in Sheet1. This formula would work: =vlookup(A2,Sheet2!A:B,2,0)
You can see it put in the cell C2:
If you don't like the #N/A error you can embrace the formula in IFERROR with the parameter "" which would yield an empty string:
=iferror(vlookup(A2,Sheet2!A:B,2,0),"")

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