1

I’m trying to create a sheet that lists entries depending on the month. As seen in the code below, I want it to look for which month is selected on the Summary sheet (in cell H2) and then display the correct data from the Data sheet according to the correct month (months are listed in column A)

=QUERY(Data!A2:$E,"where month(A)+1=Summary!H2:$H AND E = 'Expense'", 1)

I’m not sure if this is possible with query as I’m pretty sure it needs to be a numerical value after the = in the month condition

player0
  • 124,011
  • 12
  • 67
  • 124
  • 1
    Please provide sample data for each column, you can post a google sheet link and or insert a table to your original question. Also include the desired output even if it is hard coded. – CodeCamper Oct 23 '22 at 21:40
  • While a link to an spreadsheet might be very helpful, please bear in mind that questions should be self contained (this means that all the relevant details should be included directly in the question) and that email address of the spreadsheet owner might will be exposed, you might want to use a disposable Google account. – Rubén Oct 23 '22 at 22:28
  • https://docs.google.com/spreadsheets/d/1ve7W5cgCZd4-AW5NlDn_8NoMBHlh-jqpvMWPzcgAktc/edit – user3711291 Oct 24 '22 at 08:49

1 Answers1

1

try:

=QUERY(Data!A2:E, "where month(A)+1="&MONTH(Summary!H2)&" and E = 'Expense'", 0)

where Summary!H2 is a numeric number from 1 to 12

player0
  • 124,011
  • 12
  • 67
  • 124