Conditional formatting with reference sheet using INDIRECT, INDEX & MATCH? - google-sheets

How can I rewrite this formula to work in conditional formatting? If the formula returns the value "a", then I want the cell to be formatted green. See an example in the google sheets link below. =index(Availability!$B$3:$N$8,match(Sales!$A3,Availability!$A$3:$A,0),match(weeknum(Sales!B$2),Availability!$B$2:$N$2,0)) There are 2 sheets in my workbook. I want to apply conditional formatting to a "Sales" sheet based on whether or not there is a corresponding letter at the intersection of an item and a date in another worksheet. In this case, I have a "Sales" sheet with a list of items down column A and a string of dates in columns B-N, and in an "Availability" sheet I have the same list of items ( in a different order) in col A and dates in col B-N (in this sheet, it's actually the week number). So, if in the "Availability" sheet there is the letter "A" at the intersection (B3) of "arugula" and "15" AND in the "Sales" the same item and date are present, I want to highlight the cell green that intersects these two pieces of data.https://docs.google.com/spreadsheets/d/1C8bm2Jf4-u_lz3Dt3OlQ1SKQ2uijP0Qcume7akLKqas/edit?usp=sharing

try:
=INDEX(
INDIRECT("Availability!B3:N8"), MATCH($A3,
INDIRECT("Availability!A3:A"), 0), MATCH(WEEKNUM(B$2),
INDIRECT("Availability!B2:N2"), 0))<>""

Related

return row header if text present

On the sheet Dynamic 3-5 Checklist I want to use the cells in blue (columns B, D, F, etc.) as a reference to look for the text in the range B9:P21 on sheet Dynamic Grade 5, then display the words in column A.
For example, C1 on Dynamic 3-5 Checklist should be populated with the text Typing Program from B12 on Dynamic Grade 5. Also, the text from C1 appeared for any other project the name of that project from the A column would also appear in C1.
https://docs.google.com/spreadsheets/d/1lCgHPPXML5Ll9XsrMPXmNnHOEQO0RZP-aWSbMtiCfg4/edit?usp=sharingxxx
I added the formula on your sample sheet (C1, E1, G1, I1), please check if those cells show what you wanted to get.
Formula:
C1:
=textjoin(CHAR(10), true, arrayformula(if(isblank(B2:B), "", ifna(vlookup("*"&B2:B&"*", {'Dynamic Grade 5'!B$9:B,'Dynamic Grade 5'!$A$9:$A}, 2, false), ""))))
Breakdown of the important parts:
{'Dynamic Grade 5'!B$9:B,'Dynamic Grade 5'!$A$9:$A} - create an array where the 1st column is where the search term is to be searched, and 2nd column is the result we want which is column A
vlookup("*"&B2:B&"*" - pads the search term with wildcard to capture partial matches (multiple search terms can be found in one cell so normal vlookup fails)
textjoin with true - joins all results of arrayformula except blank cells
Output:
If you want to get only the unique values, prepend the arrayformula with unique.
=textjoin(CHAR(10), true, unique(arrayformula(if(isblank(B2:B), "", ifna(vlookup("*"&B2:B&"*", {'Dynamic Grade 5'!B$9:B,'Dynamic Grade 5'!$A$9:$A}, 2, false), "")))))
Note:
When copying the formula to other cells in 1:1 range, you only need to update the 1st column of {} array since B2:B correctly adjusts automatically when copied. See the pattern on the inserted formula on your sheet and you'll get the idea
UPDATE:
C2:
=ifna(join(CHAR(10), index(filter({'Dynamic Grade 5'!B$9:B, 'Dynamic Grade 5'!A$9:A}, 'Dynamic Grade 5'!B$9:B = B2), , 2)), "")

Array formula with filter and index values depending on countif

I need an array formula only in column Date_2 with results like on screenshot and that will
insert last day of month depending on Date_0 (if bunch of Color&Fruit&Meal doesn't repeat in table)
insert first minimum date of column Date_1 (if bunch of Color&Fruit&Meal repeats first time) - 1
insert second minimum date of column Date_1 (if bunch of Color&Fruit&Meal repeats second time) - 1
and so on...
Is is possible to solve it with array formula?
I've tried but I can't..
=ArrayFormula(IF(A2:A="","",IF(COUNTIF(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D)>1,INDEX(FILTER(B2:E,E2:E<>""),1,4),EOMONTH(A2:A,0))))
Google Sheets
I'm not quite sure what you need for Date_1 but try this arrayformula in cell F2 for Date_2:
=ARRAYFORMULA({"Date_2";if(IF(B2:B&""&C2:C&""&D2:D<>"",if(A2:A<>"",COUNTIFS(B2:B&"|"&C2:C&"|"&D2:D,B2:B&"|"&C2:C&"|"&D2:D,ROW(A2:A),"<="&ROW(A2:A)),),)=1,eomonth(A2:A,0),)})
I've added a duplicate sheet ("Erik Help") with the following formula in F1:
=ArrayFormula({"Date_2";IF(A2:A="",,IFERROR(VLOOKUP(B2:B&C2:C&D2:D&TEXT(COUNTIFS(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D,ROW(A2:A),"<="&ROW(A2:A))+1,"000"),{B2:B&C2:C&D2:D&TEXT(COUNTIFS(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D,ROW(A2:A),"<="&ROW(A2:A)),"000"),E2:E},2,FALSE)-1,EOMONTH(A2:A,0)))})
This formula creates the header (which you can change within the formula) and all results for Column F.
To lookup the "next instance of the group if there is one," I just wrote the formula to VLOOKUP that grouping plus a text rendering of the COUNTIFS-as-of-that-row-plus-1 for that grouping within a virtual array of each-grouping-plus-unique-count-thus-far in one column and the E2:E data in the next column. For instance, for Row 2, the formula VLOOKUPs redapplepie002
(002 being the text rendition of 001, which is the count of redapplepie as of row 2).

Google Sheets Query using important range and a dynamic cell reference

I have a roster of students (Sheet 1) and I need a formula to search another sheet (Sheet 2) to see if each student on Sheet 1 is also on Sheet 2 and if they return the word "yes"/ if they are not I would like the cell to remain blank.
This is the formula I have:
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1395p5J5oN4vYLPeyAdUQDZluwxWU53NYJPiqeHdXSEw/", "Quarter 3!A3:H"), "Select 'yes' where Col1="&$A7&"")
The formula is not working properly.
For students that are on Sheet 2 the formula is returning two rows of data (two rows of "yes) and the first instance of "yes" include characters that I did not include in the query:
For students not on Sheet 2, the formula is returning a yes with the extra characters "yes"().
I feel like I should be using an IF function, but I could not get it to work with IMPORTRANGE
use:
=QUERY(IMPORTRANGE(
"1395p5J5oN4vYLPeyAdUQDZluwxWU53NYJPiqeHdXSEw", "Quarter 3!A3:H"),
"select 'yes' where Col1="&$A7&"
label 'yes''')

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?

Sum values based on row value and column header

We have a Google Sheet doc which contains a date column with each date as a row value, and also multiple columns (some of which have the same name) and we want to sum the values in the cells where the row is a specific date, and the column has a specific header. For example where the date is 01/03/2017 we want to sum all the values which have the column header "X" on that date. Can this be done?
Yes it can be done
=SUMIF($C$3:$J$3,"X",OFFSET(C3:J3,MATCH(B1,B4:B15,0)+3,0))
Broken down
=sumif($C$3:$J$3 [<-header row with X],"X" [<-what we're looking for],C3:J3 [<-row to sum])
the formula above will sum the header row if there is an "X" (not very useful)
I used offset(C3:J3,[row number],0) with the header row range to push it down to the row matching 01/03/2017
To get the row number of 01/03/2017 I used Match() and put 01/02/2017 in cell B1
MATCH(B1,B4:B15 [range of dates] ,0)
I add 3 becuase my range starts at 4
You can hard code the date into the formula by replacing B1 with
DATEVALUE("01/03/2017")
I've not tried this in Google Sheets as I don't have access at the moment but it works in Excel and I'll try it in Sheets later.
Here's the formula that you can paste into A2 on your sheet "Sum of Data"
=SUMIF(Data!$B$1:$J$1,B$1,OFFSET(Data!$B$1:$J$1,MATCH($A2,Data!$A$2:$A,0),0))
It's all about changing the original formula to match your data and also locking the ranges correctly with the $ so that it will autofill down and across without breaking.
Use INDEX to peel off the appropriate column for SUMIF.
=SUMIF(A:A, G4, INDEX(A:E, 0, MATCH(H4, 1:1, 0)))
Considering a sheet where:
Cell B1 contains the date of interest (e.g. 01/03/2017)
Cell B2 contains the header of interest (e.g. X)
Cell B3 returns the sum of interest (values of all columns with header "X" on 01/03/2017)
Row 4 contains the headers to be evaluated (e.g. "Date", "A", "B", "X", "C", "X", "D")
Subsequent rows contain the actual data (e.g. dates in column A and data in columns B:G)
Refer to the image on the link below for details:
Example with cells of interest highlighted in yellow
The following formula should return the expected result:
=SUMIF(4:4,B2,INDEX(A:G,MATCH(B1,A:A,0),0))
I used Google Sheets in Portuguese. So, the formula actually tested was:
=SOMASE(4:4;B2;ÍNDICE(A:G;CORRESP(B1;A:A;0);0))
I hope that was usefeul.

Resources