Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets Filter Based on Dates


In Google sheets, I'm trying to lookup the value from column A that when a supplied date is between the values in column B and C. For example, if I were looking for the value when 5/8/2024 is supplied, I would get 35. I did some Googling and I think the FILTER function is the way to go but am not able to get it to work. Can anyone help me see what I am doing incorrectly?

=FILTER('Pay Periods'!A:A,'Pay Periods'!B:B>=A192,'Pay Periods'!C:C<=A192)

enter image description here enter image description here

enter image description here


Solution

  • Seems to be an issue with the logic in your formula. I am assuming you are getting a #N/A No matches found... error.

    In the row shown in the screenshot below and in reference to your example,

    Screenshot 1

    4/26/2024 is not greater than or equal to value in A192 (5/1/2024). Consider changing

    =FILTER('Pay Periods'!A:A,'Pay Periods'!B:B>=A192,'Pay Periods'!C:C<=A192)
    

    to:

    =FILTER('Pay Periods'!A:A,'Pay Periods'!B:B<=A192,'Pay Periods'!C:C>=A192)