Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =query({'Sheet1'!I2:I,'Sheet1'!L2:L;'Sheet2'!I2:I,'Sheet2'!L2:L},"Select Col1, sum(Col2) group by Col1 label Col1 'Month'")
- | Month | sum
- |
- | 2018/12 | £ 35.00
- | 2019/01 | £ 155.00
- | 2019/02 | £ 60.00
- | 2019/03 | £ 210.00
- | Grand Total | £ 460.00
- | Month | sum | Sheet1 | Sheet2
- |
- | 2018/12 | £ 35.00 | £10 | £25
- | 2019/01 | £ 155.00 | £100 | £55
- | 2019/02 | £ 60.00 | £30 | £30
- | 2019/03 | £ 210.00 | £110 | £100
- | Grand Total | £ 460.00
- ={QUERY({Sheet1!I2:I, Sheet1!L2:L; Sheet2!I2:I, Sheet2!L2:L},
- "select Col1, sum(Col2)
- where Col1 is not null
- group by Col1
- label Col1 'Month', sum(Col2)'Sum'", 0),
- {"Sheet1"; QUERY(ARRAYFORMULA(IFERROR(VLOOKUP(QUERY(QUERY({Sheet1!I2:I, Sheet1!L2:L},
- "select Col1, sum(Col2)
- where Col1 is not null
- group by Col1", 0),
- "select Col1", 0),
- {Sheet1!I2:I, Sheet1!L2:L}, 2), )),
- "select Col1 where Col1 is not null", 0)},
- {"Sheet2"; QUERY(ARRAYFORMULA(IFERROR(VLOOKUP(QUERY(QUERY({Sheet2!I2:I, Sheet2!L2:L},
- "select Col1, sum(Col2)
- where Col1 is not null
- group by Col1", 0),
- "select Col1", 0),
- {Sheet2!I2:I, Sheet2!L2:L}, 2), )),
- "select Col1 where Col1 is not null", 0)}}
Add Comment
Please, Sign In to add comment