How to calculate values of column B if column A has specific value?

Hi,

I have tables organised like this:

Column A          Column B
0                 4
0                 7
0                 2
1                 7
1                 3
1                 43
1                 2

To make things more complicated, I am automatically reading these tables and combine them into another one by using this command:

SomeAction(INDIRECT("'file:///C:/myfile.csv'#.B$13:B$1000"))

In this new table, how can I tell LO Calc to perform calculations on all rows in B if A includes a specific value (e.g. use only rows of B if in the same row A is 0)?
I was thinking about something like

IF(INDIRECT("'file:///C:/myfile.csv'#.A$13:A$1000"=0, SomeAction(INDIRECT("'file:///C:/myfile.csv'#.B$13:B$1000")))

bot it doesn’t work. Thanks in advance.

It seems to me that one bracket should be in front of the = 0 - =IF(INDIRECT("'file:///C:/myfile.csv'#.A$13:A$1000")=0, SomeAction(INDIRECT("'file:///C:/myfile.csv'#.B$13:B$1000")),"")

Unfortunately that doesn’t work for me either. I get the error 504 if I try to get, e.g., the sum of values in B with this example.

OK, please try =SUMIF(INDIRECT("'file:///C:/myfile.csv'#$myfile.A$13:A$1000"),0,INDIRECT("'file:///C:/myfile.csv'#$myfile.D$13:D$1000")) (just use SUMIF() and add name of the sheet before range address)

I assume that your SomeAction(INDIRECT("'file:///C:/myfile.csv'#.B$13:B$1000")) actually works (it looks odd to me and actually you don’t need INDIRECT at all, you could just pass the reference to SomeAction()) and does what it is supposed to do, despite the omitted sheet name in the reference. So, a missing parentheses is one thing, the other is you want to enter it as array/matrix formula, with adding the sheet name at appropriate places something like =IF(INDIRECT("'file:///C:/myfile.csv'#$myfile.A$13:A$1000")=0, SomeAction(INDIRECT("'file:///C:/myfile.csv'#$myfile.B$13:B$1000"))) which you close with Shift+Ctrl+Enter instead of just Enter. Also try if this eliminating INDIRECT then works: =IF('file:///C:/myfile.csv'#$myfile.A$13:A$1000=0, SomeAction('file:///C:/myfile.csv'#$myfile.B$13:B$1000))