Highlight if cell exists in a range in other sheet - google-sheets

I'm trying to highlight a row (or cell, if that's easier) if that value exists in a range in an other sheet in the same document.
Details: In Google Sheets, I have one sheet named "Application", with email addresses in column D. In a different different sheet (named "Accepted") I have the same data copied from the application sheet, also in column D.
I want to highlight the cells with email addresses in the "Application" sheet which has been copied over to the "Accepted" sheet.
I know Conditional formatting with Custom formula is the way to go, but I'm unable to find the correct syntax.
What is the correct formula for this?

In Google Spreadsheets conditional formatting across sheets is not nearly as straightforward as within a single sheet, because of security and therefore authorisation. You may, for speed for example, prefer to copy the content of Accepted into Application to avoid that issue, or write a script instead. At least keep the ranges as small as practical.
However it is possible, though may be slow and require authorisation.
Please clear any conditional formatting from Application ColumnD then:
Select ColumnD in Application, Format, Conditional formatting..., Format cells if... Custom formula is and
=COUNTIFS(IMPORTRANGE("k e y","Accepted!D:D"),D1)>0
with highlighting of your choice and Done.
k e y above represents the unique identification code for Accepted (will look something like 1u4vq8vDne-aKMVdJQPREGOxx7n99FqIb_kuJ_bG-PzM).

Related

I am trying to use vlookup as a conditional formatting formula

I have a Google sheet that has a roster of people. I want the sheet to automatically color code people on the roster tab that are also present on a second tab that lists people who have dietary restrictions. I thought that conditional formatting would be the way to go, but I can't get the formula to work. I also can seem to get the conditional formatting formula to be relative based on the row. This is the formula that I have so far. A5 is the first cell that contains the person's ID number. The ID numbers are listed in column A on the "Dietary Restrictions" sheet.
=NOT(ISNA(VLOOKUP(A5,'Ghost Students'!A:H,1,FALSE)))
You want to highlight values from A5:A in one sheet (let's call it Roster) if they are present in column A from another sheet (Dietary restrictions).
Since conditional formatting formulas cannot reference other sheets, you have to use INDIRECT in order to reference that.
You can then use MATCH to check if the value is present.
Your formula could be like this:
=MATCH($A5,INDIRECT("'Dietary restrictions'!A2:A"),0)
Output:
Sheet Roster:
Sheet Dietary restrictions:
How about making vlookup formula grabbing data about dietary conditions from another sheet, and then putting conditional formatting.
You can hide information about dietary conditions if you want and apply conditional formatting based on hidden column:
Just tried. Conditional formatting works with hidden columns too.

Google Sheets - Conditional Formatting Based on a cell containing a specific formula

I have a budget tracking sheet which automatically enters an account number using VLOOKUP from another sheet to match the contract that is being paid. This works perfect 95% of the time. The remaining 5% are instances when the contract is being paid from a different account than the default for one reason or another causing me to have to type over my formula to manually enter the account number. I'm looking for a way to conditionally format these cells. Something like: =IF(E2:E<>"=IFERROR(VLOOKUP(""*"...
I'm not sure if this is even possible, but any direction would be appreciated!
You can check whether your formula contains a particular expression, in this case the word VLOOKUP. Put the follow custom function in the conditional formatting menu:
=isnumber(SEARCH("VLOOKUP",formulatext(A1)))
and this will highlight a cell if the cell A1 contains a vlookup formula.
Feel free to change "VLOOKUP" with another formula text to make it more specific if you will.

How to highlight duplicate values in a sheet that appears in another sheet

I know how to apply conditional formatting if there are duplicate values in a column and I know how to use a formula to that references values from multiple sheets; however, what I want to do is apply formatting to a value if it is a duplicate in another sheet.
Example: I have sheets "friendlies", "healthcare", "IT" and "marketing" that contain names and contact information. Email addresses are always in column E.
Occasionally someone gets moved from a vertical, healthcare for instance, into the friendlies sheet.
When someone gets added to the friendlies worksheet, I want their email cell (in column E) in the friendlies sheet to turn red to remind me to remove them from the healthcare sheet.
Is it possible create a formula that looks to another sheet for a duplicate? I tried the below with no luck:
=countif(Healthcare!E:E,E1)>1, as well as =countif(Healthcare!E:Healthcare!E,E1)>1 and then finally =countif(Healthcare!E:Healthcare!E,Healthcare!E1)>1
Does anyone have any insights to help?
Presumably in connection with security, conditional formatting across sheets can be a bit of a rigmarole but the CF formula rule is very simple if you are prepared to make use of a helper column.
Taking a similar approach to what you tried, the helper column, say F should be populated with, in say F1, and copied down to suit:
=countif(healthcare!E:E,E1)+countif(IT!E:E,E1)+countif(marketing!E:E,E1)
Then it is just a matter of selecting ColumnE in friendlies and Format - Conditional formatting..., Custom formula is and:
=F1>0
with selecting red formatting of choice and Done.
An alternative to a helper column is to apply named ranges and INDIRECT:
=countif(indirect("hMail"),E1)+countif(indirect("imail"),E1)+countif(indirect("mMail"),E1)
hMail for example the name for ColumnE in healthcare.

Google Sheets Custom conditional formatting multiple conditions

I made a spreadsheet in google sheets in my last company which highlighted all my rows based on my qualifying conditions. I can't remember what conditional formatting I used.
I have tried the =IFAND and =AND functions along with others.
This is what I am trying to do:
If column B says DTC, even if something else is also in cell, and the dates are between two ranges I want it highlighted. Then I will have multiple rules that vary in dates and words. I have attached a new demo sheet to help.
https://docs.google.com/spreadsheets/d/1yX_Ohfdz0uRKvOB8hvOpcO2sb5dSaAP6Zw-aR_HzK2E/edit?usp=sharing
The formula I have in there now is =AND($B2="DTC",E$2>=DATE(2017,10,1),E$2<=DATE(2018,10,1))
To find both DTC and DTC-DCL with a wildcard try using if with search like this:
=if(and(search("DTC*",$B2),$E2>=date(2017,10,1),$E2<=date(2018,10,1)),"true","false")

Format cells based on current value and another one

Sheet regarding this question.
I have a set of sheets where each person must use a drop down box to select a house they would like to view. We can easily add a house to the list by inserting the address, and a URL into the "houses" sheet and it will be shown in the dropdown list and the results table.
Everything works so far, but if a house becomes unavailable, I want to mark it unavailable on the "houses" sheet, and then all occurrences of that specific house in the dropdown cells and results section should have a red background.
I could use conditional formatting, but this would require me to apply a different formula to each cell and that wouldn't be practical.
I regret not elegant but I think your layout is not well suited to Google Sheets' strengths. The best I can suggest is in say J2 of sheet Choices:
=vlookup(B2,Houses!$A:$C,3,0)
copied down to J30 and J2:J9 copied across to ColumnN. Then select Choices ColumnsB:F and Format - Conditional formatting..., Custom formula is and:
=J1="No"
with formatting of red background Done.
You might want to hide columns J:N.
You should just use conditional formatting.
Step 1: Select Cell B2, go to conditional formatting and create a new rule, "Use a formula to determine which cells to format".
Step 2: Use the following formula:
=VLOOKUP(B2,Houses!$A$3:$C$42,3,FALSE)="No"
Note: This B2 value since it isn't using $, moves dynamically depending on what cells your formula is applied to. The VLOOKUP looks up the B2 value in the depicted range and returns the 'Available' column (column 3 on the Houses sheet). We're matching on "No" specifically, I believe its case sensitive so watch out for that caveat.
Step 3: Set your format to Red.
Step 4: Make sure your 'Applies to' box is pointed to the following range:
=$B$2:$F$9
Personally I hate hard coded ranges like these, you should look into dynamic named ranges. That way you can just reference a named range instead of the A3:C42 range for both your Data Validation dropdown as well as these formulas.

Resources