Search code examples
if-statementgoogle-sheetslambdacountarray-formulas

Google Sheets ArrayFormula to Compare Multiple Cells from Different Rows


I'm making a checklist of Disney Blu-rays. Some Disney movies are available in 4K but some are not. I'm trying to create a column that will show if a movie release is available in a higher quality than the entry for that row.

Here is a simplified test sheet that should hopefully make my goal more clear... https://docs.google.com/spreadsheets/d/1L2-npiEdTE9ardDi2q38sYhkKRFKAPCu_gtJFbOZa80/edit?usp=sharing

I've found a ton of ways to compare rows, look for duplicates, etc. But despite my limited but best efforts, I can't find a way to combine what I've found in a way that works towards this goal. The best I've been able to do is find duplicate titles but I've not been able to compare that against the Original Theatrical Release Year, and Blu-ray vs 4K release columns.

I'd like to do this through an ArrayFormula so that any rows I add are easily and automatically rendered into the formula without any extra work. Any help would be greatly appreciated! Thank you.


Solution

  • try:

    =INDEX(LAMBDA(a, b, c, d, LAMBDA(x, IF(a="",,
     IF(IFERROR(x, "No")="No", "Yes", "No")))(VLOOKUP(a&d, 
     {FILTER(FILTER(a&d, b), NOT(COUNTIF(FILTER(a, c), FILTER(a, b)))); 
      FILTER(FILTER(a&d, c),     COUNTIF(FILTER(a, b), FILTER(a, c)))}, 1, )))
     (A3:A&B3:B, C3:C="Blu-ray", D3:D="4K", ROW(B3:B)))
    

    enter image description here