R
Ronny
Hi all,
I'm looking at doing some "special" SUM & IF, and I know the
formula I want if it all had been in one sheet. But when trying to go
across worksheets I run into problems.
If on one sheet I would check column L for a criteria (=1 in example
below, or a cell ref. in real life), if criteria is right I will add
column H * column I and summarize the total. This is the formula I
would use:
{=SUM(IF(L2:L10=1,H2:H10*I2:I10,0))}
Now I want to combine this with the possibility of making formulas like
these:
=SUM(Sheet1:Sheet10!B3)
So I want to check cell B1 on Sheet1 to 10 is equal to B1 on the
current sheet, if so multiply B2 and B3 on that sheet and in the end
add up all the ones that meet the "IF" requirement. I was thinking
of a formula looking something like this:
{=SUM(IF(Sheet1:Sheet10!B1=B1,Sheet1:Sheet10!B2*Sheet1:Sheet10!B3,0))}
This gives #REF!
I've tried to create a couple of other array formulas across
worksheets, and I can't get any of them to work.
Is it not possible to use arrays { } (ctrl + shift + enter) across
worksheets? Or is it just something I'm missing that must be included
when working across worksheets that I can add and everything is
working?
If this is not possible through an array formula, can anyone start
pointing me in the right direction for creating a custom user function
in VBA for this?
I'd be happy for any help on this since it's been bugging me for a
couple of days now.
Ronny
I'm looking at doing some "special" SUM & IF, and I know the
formula I want if it all had been in one sheet. But when trying to go
across worksheets I run into problems.
If on one sheet I would check column L for a criteria (=1 in example
below, or a cell ref. in real life), if criteria is right I will add
column H * column I and summarize the total. This is the formula I
would use:
{=SUM(IF(L2:L10=1,H2:H10*I2:I10,0))}
Now I want to combine this with the possibility of making formulas like
these:
=SUM(Sheet1:Sheet10!B3)
So I want to check cell B1 on Sheet1 to 10 is equal to B1 on the
current sheet, if so multiply B2 and B3 on that sheet and in the end
add up all the ones that meet the "IF" requirement. I was thinking
of a formula looking something like this:
{=SUM(IF(Sheet1:Sheet10!B1=B1,Sheet1:Sheet10!B2*Sheet1:Sheet10!B3,0))}
This gives #REF!
I've tried to create a couple of other array formulas across
worksheets, and I can't get any of them to work.
Is it not possible to use arrays { } (ctrl + shift + enter) across
worksheets? Or is it just something I'm missing that must be included
when working across worksheets that I can add and everything is
working?
If this is not possible through an array formula, can anyone start
pointing me in the right direction for creating a custom user function
in VBA for this?
I'd be happy for any help on this since it's been bugging me for a
couple of days now.
Ronny