Conditional formating depending of two values in other tab (google Sheets) - google-sheets

I am creating a database in which the staff is listed (tab named "Sheet1"). This database includes: a locker room(col A), a locker number (col B) and the name of the person (col C).
In another tab (named "Sheet2"), I have created a multi-column table that includes all the locker room and locker numbers concatenated with _.
If the name of the person is "Test", i would like the corresponding box of the table is put in red like that :
So I tried the formula below but I can't get what I want :
=ArrayFormula((B2<>"")*(RECHERCHEV(REGEXEXTRACT(B2;"\d+")&"_"&REGEXEXTRACT(B2;"\d+");{INDIRECT("Sheet1!A:A")&INDIRECT("Sheet1!B:B")\INDIRECT("Sheet1!C:C")};3;FAUX)="Test"))
Can you help me with that please ?

you may try this custom formula within Conditional Formatting.
=XMATCH(A1;(FILTER(INDIRECT("Sheet1!A:A")&"_"&INDIRECT("Sheet1!B:B");XMATCH(INDIRECT("Sheet1!C:C");"Test"))))

Related

Fetching cell values based on selection in drop down list in google spreadsheet

I have a sheet called 'Student Contact Detail' as Sheet1 and another sheet called 'Student Credential' as Sheet2.
->Sheet1 has columns (Sr. No.>(A), Contact No.(B), Department Name(C), Student ID(D)).
->Sheet2 has columns (Sr. No.>(A), Contact No.(B), Department Name(C), Student ID(D), Login Link(E), User Name (F)).
I can fetch data of Row (C)& (D) by (A) with formulae "=vlookup($B2,'Student Contact Detail'!$B:$D,2,false)" & "=vlookup($B2,'Student Contact Detail'!$B:$D,3,false)".
But I also want a functionality, where I can fetch Contact No.(B) using Department Name(C).
Tried Formula =vlookup($C3,'Student Contact Detail'!$B:$D,1,false) but is showing #NA error.
ANY SOLUTION PLEASE.
Vishalsagar, I assume that there only one Contact No for each Departent Name? If so, try this:
=VLOOKUP($C2,{'Student Contact Detail'!C:C,'Student Contact Detail'!B:B},2,0)
Since VLOOKUP can only look to the right, we cheat, and build a virtual array, using {...}. We put column C first, and then beside it, we put column B, like this: {C:C,B:B}.
Then we use VLOOKUP to lookup column C, and find value B.
Other ways such as INDEX(MATCH can also be used, but I like this trick of just reversing the columns with a virtual array, for its simplicity.

Sort Range Ignoring "" Flavor of Blank on Google Sheets

I have a spreadsheet with 2 main columns.
Column A is the student's name.
Column B is the student's grade.
Other columns (not shown) list various information about the student that the end users input.
End users click on the Data Validation Arrow to select the student in Column A, and the student's grade is auto populated in Column B.
The formula in Column B is:
=IF(A2="","",Index(All!$B:$B,Match(A2,All!$A:$A,0)))
The All sheet contains a master directory of the Students and their Grade level assignment.
The Problem:
When users attempt to re-sort the data using the Sort A-Z menu option in B1, it includes the blank cells in the sort - The blank cells come first, moving all the relevant data to the bottom of the sheet.
I understand that G-Sheets considers "" to be text. Is there another method to write my formula that would keep the Grade column blank, but allow for the sorting feature to function as end users would expect?
You can implement two additional comments where you filter the results before sorting them:
=SORT(FILTER(A2:B,not(B2:B="")),2, true)

Google Sheets Formula: List Column A input if Column G input is equal to "X"

I am interested in finding a formula that will allow me to make lists of cell input from Column A, but only list the cells that have a certain value in the same row in Column G.
Here's more information: I am doing rosters for my school. Each row is a different student, their name entered into Column A. Columns G through J are their assigned classes on certain days. I would like to pull lists of students who have certain classes on specific days (Tuesday through Friday). For instance, I would like a formula that allows me to make a list of all students (Name from Column A) whose class listed in column G is "Art." So basically I want to pull daily class rosters.
Any help would be greatly appreciated by me and all of my teacher colleagues!
Thanks!
=FILTER (A1:J200,G1:G200="Art")
Or
= FILTER ({A1:A200,G1:G200},G1:G200="Art")
You're looking for this function FILTER
You could also use QUERY
=QUERY (A1:J200,"Select A,B,C,D,F,G,J Where G contains 'Art'")

partial google sheets string cell comparison

The Primary Sheet has basic info ( narrowed here ), including
Column B - a flag to say "Yes" or "No/Stop"
Column C - a Company Name
A Second sheet "stopphrases" will have a growing list of words and phrases in it. If one of these words match first sheet called "data" > Column C (Company Name), Column B will updated to a "No"
IE -
1) If stopphrases!sheet, range A1:A25 contains "UPS"
2) And the Primary Sheet has "UPS Shipping"
This "partial" match should catch it and insert flag into data.Column B
=MATCH(""&stopphrases!A1:A10&"", C6,0)
I seem to be able to check a partial from a single cell and check the range, but not got the other way - get the partial words from multiple cells and check against a single cell.
I also tried
(If Statement)
=IF(COUNTA(IFERROR(FILTER(stopphrases!$A$1:$A$25,stopphrases!$A$1:$A$25=C2))),"Yes","No")
The results I am looking for are
So again -
IF StopPhrases!A1:A25 Range has a phrase "UPS"
THen any entry in first sheet, Company Name, Column B that CONTAINS "UPS" - IE "UPS Shipping" should flag - this way I can run a condition.
The end result is if a match occurs a "stop" happens and that record doesn't get processed in other spreadsheets that are connected.
You can use regexmatch or regexextract to do this:
first to make the dynamic list of stopphrases you use a JOIN function, an INDIRECT function so you can use COUNTA to allow for it to automatically add the correct number of phrases,
=JOIN("|",INDIRECT("E2:E"&COUNTA(E2:E)+1))
Then you use arrayformula and regexmatch to dynamically match your list of stop words:
=ARRAYFORMULA(IF(ISTEXT(B1:B),if(REGEXMATCH(B1:B,$D$1),"STOP","GO"),))
=ARRAYFORMULA(IF(ISTEXT(B1:B),if(REGEXMATCH(LOWER(B1:B),$D$1),"STOP","GO"),))

how to create "" for a column containging duplicate values

So I have a worksheet with multiple columns and one of the columns contains description of the product.
I have multiple lines of apples and multiple lines or orange.
Is there a forumla that can display only one cell with the product description with apples, oranges, and leave rest of the duplicates blank ("").
I wouldn't really recommend using blanks there. Your original data setup is perfect for a flat file and makes performing calculations like Countif/s, Sumif/s, etc really easy.
If you absolutely must change it, you could use column E as a helper with this formula starting in cell E2 and copied down (note, this formula requires that the data be sorted by Product as shown in your example):
=IF(B2=B1,"",B2)
Then copy the helper column -> select B2 -> right-click -> paste special -> values
And delete the helper column.

Resources