Highlight rows with unique values when compared to a different sheet - google-sheets

I have two sheets:
The first is the Master Sheet of responses to a survey.
The second will be an Update Sheet auto-generated from the new responses.
New responses can be either entirely new rows or edits/updates to previous entries.
I am trying to create a Conditional Formatting rule to auto-highlight any rows in the Update Sheet which do not match the corresponding rows in the Master sheet.
(A row "does not match" when it shares the same Respondent ID number as the Master sheet row but contains different information in the following cells.)
I'm also trying to make it ignore any empty cells.
I created named ranges: "Master" and "Update" on each sheet respectively.
Here's an image of what I'm trying to accomplish:
I'd like to accomplish this without scripts or using a helper column if possible.
Any help from you genuine experts out there would be greatly appreciated!
And here's the Demo Sheet for reference.
So far I have tried to use INDIRECT to accomplish the cross-sheet highlighting (below). However, that didn't work so I'm obviously doing something wrong.
CONDITIONAL FORMATTING:
- Apply to Range: A3:A200,F5:F200
- Custom Formula: =ISNA(match(A3,INDIRECT("Master!F5:AS"),0))
Update #2:
With help from #I'-'I I've been able to get closer with:
CONDITIONAL FORMATTING:
Apply to range: A3:F200
Custom Formula: =and(isna(match($A3,INDIRECT("Master!F5:F"),0)),not(isblank($a3)))
However, while it now highlights the "New Data" rows, it ignores the "Updated Data" row which has the same Respondent ID but different data in the following cells.
Any suggestions on how to rectify this would be appreciated!

Conditional formatting custom formula applied to range A3:F200:
=IF(LEN($A3),IFERROR(SUMPRODUCT(QUERY(INDIRECT("Master!F5:J"),"where F = "&$A3&" limit 1")<>$A3:$E3),1),)
HTH
Adam

With help from #I'-'I I now have the following solution, which works perfectly. :
=AND(NOT(ISBLANK($A3)),OR(IFERROR(ARRAYFORMULA(VLOOKUP($A3,INDIRECT("MASTER!F5:J"),COLUMN($A$1:$E$1),0)<>$A3:$E3),1)))
#I'-'I provided this explanation:
VLOOKUP to lookup ID(A3) in the master sheet and return the
corresponding 5 columns(5 cells).
VLOOKUP results are compared
against current row's 5 columns(<>A3:E3).
IFERROR to return TRUE if
lookup fails(suggesting NewData).
ISBLANK to ignore blank rows.
AND/OR/NOT Self explanatory. Used to combine TRUE/FALSE in a specific
way to achieve intended result.
The solution by #AdamL also works, but I don't know how to give credit to two answers at the same time.

Related

COUNTIF Formula moves down when row at top added

I have the following COUNTIF Formula in my Google Sheet.
=COUNTIFS('Events/Incidents'!$E$3:$E,X4,'Events/Incidents'!$I$3:$I,"Accident")
This is a sample of the sheet which has the formula in the first row under the "Accidents" header:
It works until a user adds a row 3 to the top of the source sheet (Events/Incidents) then the formula changes to the following so that it captures row 4 down instead of the desired row 3.
=COUNTIFS('Events/Incidents'!$E$4:$E,X4,'Events/Incidents'!$I$4:$I,"Accident")
I used the Query function for "All Events" (the first 3 columns). The Countif formula is under each of the Incidents. In my Countif example, X4 is the Employee, John White which was returned in the QUERY.
The QUERY continues to return/include row 3 but I don't know how to do this for the individual Incidents. I tried adding ArrayFormula to the Countif function but I have the same problem.
Would appreciate some help with this.
I understand that you want to update your QUERY to reflect the correct row without resorting to returning the Branch in every response. If my comprehension is correct, there is a way to reach your goals with little modification.
First, you'll have to create a named range that includes the whole table (from the headers to the last row). You can then use this named range in every formula so new rows can be detected without changing the formula per se.
Finally, you can modify your QUERY to return only the values of Incidents in a Branch with something similar to =QUERY(myNamedRange,"SELECT G WHERE A = 'Auckland'"). That QUERY won't return the Branch, only the Incidents. If you keep having any doubts, please ask me for further help.
I worked it out by combining Countifs with ImportRange:
=COUNTIFS(IMPORTRANGE("1-f6OU8ylDSlpqdpt4P5B7GDcIel3IboVkUbY2huMA6U","Events/Incidents!$E$3:$E"),X4,IMPORTRANGE("1-f6OU8ylDSlpqdpt4P5B7GDcIel3IboVkUbY2huMA6U","Events/Incidents!$I$3:$I"),"Accident")

google sheet data filter for last a few days

I have a google sheet to log what I do at work every day.
for example
no filter
I managed to figure out how to filter it by today.
highlight colon -> data -> filter -> date is today
for example:
only today
but I could not figure out how to filter it by the last x number of days
for example:
goal
I guess I will need to make a custom filter, but I have a really hard time figuring out how to make custom filters in google sheet.
Please help me. Thanks in advance.
I solved this in two ways. One with a filter view, and one with a formula you could also use. Both are in my example spreadsheet based on your provided data.
Filter View:
To view my example use the above link and go to the sheet "Filtered". Then apply "Filter recent days" which is a filter I created. I created this filter by filtering column A for the condition "Date is after". I then chose "exact date..." which allows formula input. The formula I used was =TODAY()-4 which simply filters the data for every instance of column A which is after 4 days ago.
Filter formula:
To accomplish this, I left the original data in columns A and B. Then in C5, I entered the formula =FILTER(A3:B,A3:A>TODAY()-4), which uses basically the same method as above. This will produce a separate output next to your original data with only the recent entries.
I also took this a step further by moving the formula down a cell, and then replacing the 4 in the formula with D2. Now you can change the number in D2 to change how many days it displays.

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.

reference cell via two partial matches on another cell

I need to match two conditions on the cell Name and add the price information into cell price if both condition match. In other words, if Name contains both conditions, get the price. I tried different approaches using QUERY, SEARCH; FIND; VLOOKUP but I got stuck somewhere in the middle. Here's the example sheet (Google Spreadsheet solution preferred over Excel):
https://docs.google.com/spreadsheets/d/1zwG3_5Ctg_IZ1kI04Uee-qIvMrNQ4GmEwySmYcMKLfA/edit?usp=sharing
Maybe important: Both, the Name values as well as the whole reference table get pulled from other files dynamically. So I don't know anything concerning order or length of these columns in advance, not even if there are matches at all.
In addition to previous answer AND given the current set of data (in a Google spreadsheet), in B2 try:
=ArrayFormula(iferror(vlookup(regexreplace(A2:A; "[^A-Z]"; ""); {E2:E&F2:F\G2:G}; 2; 0)))
and see if that works ?
Based on your spreadsheet table:
you can try the following formula:
this formula works in excel not in google spreadsheets
=IFNA(INDEX($G$2:$G$6;MATCH(1;COUNTIFS(A2;"*"&$E$2:$E$100&"*";A2;"*"&$F$2:$F$100&"*");0));"NOT FOUND")
this is an array formula, so press ctrl+shift+enter to calculate the formula.
i think it will do the job.
here is the example file to download

conditional formatting for newly added rows

Ok, I really have no business working in spreadsheets or any data entry program for that matter. So basically what I am saying is I have no idea how to use much of the formula and script/language features. So any help would be AWESOME!
Heres my issue...
I have two Columns, One contains Conditional formatting (Cell Color) for for 3 variables respectfully. The Other Column is a DropDrown with a list.
I'm hoping to avoid explaining to the person(s) here how to keep applying rules as new Rows are added to the end of the sheet.
Is there an a script someone could dig up for me that (I'm guessing onEdit) will automatically apply my Conditional Formatting and DropDowns the new Rows?
Thank you so much!
I'm not sure this would ever receive another answer so, for the moment considering only I need to to just compare b3-g3>color h3 b4-g4> color h41:
In New Google Sheets, apply your formula to H2:-
=arrayformula(if(G2:G=0,"",if(B2:B=G2:G,"Completed",IF(B2:B>G2:G,"Back Ordered",if(B2:B<G2:G,"Over Shipped")))))
and rules like these in Conditional formatting...:
and I think as new rows are added and data populated in A:G the formulae (both if and Conditional) extend automatically, with no fill where the cell in Column G is 0 or empty.

Resources