Search code examples
google-sheetsgoogle-sheets-formula

Show value if months equals current month


I have a google sheet with monthly targets per product, and in another sheet I want to reference this and only show the target of the current month.

            June 2022   July 2022   August 2022
Product 1   50          60          70
Product 2   20          40          60

The formula I tried is:

=IF(MONTH(A1)=MONTH(targets!$B$1:$D$1), targets!B2:D2, "")

Where A1 has =TODAY()


Solution

  • Use FILTER() function.

    =FILTER(B2:D3,MONTH(B1:D1)=MONTH(F1))
    

    enter image description here