=SUM(IMPORTRANGE("1kWMBhk0T423p411K5_5sKOMQFdAsEDapdasYyr9gZj8","Oct!N2:N") "SELECT Col16, where Col16 contains 'Paid' )")
I need to calculate only the total of paid invoices
Does somebody had a similar situation?
The formula is using incorrect syntax, and there are semantic issues as well. You are only importing one column. That column cannot simultaneously contain 'Paid' and a number in the same row.
Use this pattern:
=query(
importrange("1kWMBhk0T423p411K5_5sKOMQFdAsEDapdasYyr9gZj8", "Oct!A2:Z"),
"select sum(Col9) where Col14 contains 'Paid' label sum(Col9) '' ",
0
)
Replace Col9
with a reference to the column you want to sum, and Col14
with a reference to the column that contains Paid
flags.