google-sheetsgoogle-sheets-formula

Check if Cell Contains Month and Compare to Date


I have a dataset that contains a log of tests passed and failed. The tests are in YYYY MONTHNAME format. Look at the screenshot below as an example

enter image description here

I have specific dates for these tests on another tab named Test Date Mappings that I need to compare to columns A and B.

View sample sheet

What I am trying to achieve is columns F and G. On column F, if a person has a test in column C that falls between the start (column B) and end date (column C) then they have a "Yes" in column E. Same with column G using the tests failed column (E).

If a person does not have a start date then the cell should be left blank.

Edit: Updating image and post to reflect a scenario I did not think of initially.


Solution

  • Here's one approach you may test out:

    =map(C2:index(C:C,match(,0/(C:C<>""))),lambda(Σ,if(or(map(iferror(split(Σ,", ",)),lambda(Λ,
     index(isbetween(xlookup(Λ,--'Test Date Mappings'!A:A,'Test Date Mappings'!B:B,),indirect("A"&row(Σ)),indirect("B"&row(Σ))))))),"Yes","No")))
    

    enter image description here