Using Query function to sum transactions by category and month

It might be easier for you to use built in solutions. See if the Transaction Tracker for Google Sheets helps out.