0

I have created filter function to Filter some sort of data and it is working fine but later converted it to Query but i am stcuk on one thing that how to Filter the Date Column based on month values like (1,2,3,4,5,6,7,8,9,10,11,12). I have created a Data validation for all 12 months.

your help will be much appreciated.

Filter Function:

=IFERROR(FILTER('Sheet1'!B:K,'Sheet1'!D:D=M4,month('Sheet1'!E:E)=X4),"No Data Available")

Query Function:

=QUERY({'Sheet1'!B:K}, "SELECT * WHERE Col2 contains '"&J4&"' AND Col3 contains '"&M4&"' AND Col4 = month(date'"&text(X4,"M")&"') ORDER BY Col2 ASC",0)

Unable to make this Query line AND Col4 = month(date'"&text(X4,"M")&"')

2 Answers 2

1

Try:

=QUERY({'Sheet1'!B:K}, "SELECT * WHERE Col2 contains '"&J4&"' AND Col3 contains '"&M4&"' AND month(Col4) ="&X4-1&" ORDER BY Col2 ASC",0)
Sign up to request clarification or add additional context in comments.

Comments

1

try:

=QUERY({Sheet1!B:K}, 
 "where Col2 contains '"&J4&"' 
    and Col3 contains '"&M4&"' 
    and month(Col4)+1 ="&X4&" 
  order by Col2", )

you can skip these:

  • select * if you want to get all columns you can just skip select argument
  • single quotes are needed only if sheet name contains a space
  • months in query start from 0 (as January) so we just add +1
  • when ordering its asc by default so we can skip it
  • zero 0 as the 3rd argument can be omitted

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.