It seems like you're trying to filter values from the range Q3:Q13 based on certain conditions, with the condition depending on cells in a dynamic column based on today's date.
However, your formula has a bit of redundancy and is also not structured correctly in Google Sheets. You cannot use the OR operator directly in the way you’ve shown.
Here's a revised version of your formula that simplifies the logic and adheres to Google Sheets syntax:
To create a FILTER formula in Google Sheets that returns values from Q3:Q13 based on whether the corresponding values in a dynamically determined column are either 35 or 37, you'll need to properly structure the formula.
You can't use OR in the manner shown in your formula. Instead, you can combine the conditions directly within the FILTER function using a logical expression. Here's how you can do that:
This formula will filter the range Q3:Q13 where the corresponding values in the column that is determined dynamically (based on today's day plus 23) equal 35.
Explanation:
TODAY() gets today’s date.
DAY(TODAY()) gets the day of the month (1-31).
DAY(TODAY()) + 23 calculates the column index to index into dynamically.
ADDRESS(3, ...) and ADDRESS(13, ...) get the addresses of the first and the last rows for this dynamic column.
INDIRECT(...) returns the range defined by those addresses.
FILTER(...) will return values from Q3:Q13 where the condition you define is true.
If you have multiple conditions to consider (which might necessitate using an OR), you will need to combine them in the FILTER function. Here’s how you can do that if you have different filters:
In this case, another_condition could be another logical test. You would need to implement that based on your specific needs.
Remember, if TODAY() is past the end of the month and the DAY(TODAY()) + 23 exceeds the total number of columns, you may encounter a reference error. Adjust accordingly based on your actual dataset's size.
The + operator is used for logical OR in this context. If either condition is true, the filter will include that row.
The INDIRECT(ADDRESS(3, DAY(TODAY()) + 23) & ":" & ADDRESS(13, DAY(TODAY()) + 23)) part dynamically references the range based on the day of the month plus 23.
Important Note:
Always ensure that the column you are trying to access with DAY(TODAY()) + 23 doesn’t exceed the number of columns available in Google Sheets (which goes up to column ZZ).
If you plan to check multiple conditions, you can extend the same principle: