Ah, thank you for that explanation - now I understand what the formula
is doing. I obviously simplified the spreadsheet description in my
original question but cannot seem to get the correct result. Here is
how I have extended your suggestion:
=SUMPRODUCT((AND($C$6:$C$1000="103",$D$6:$D$1000="120ml")*($I$6:$I
$1000)))
As you can see, there are two conditions. I want to add up the values
in column I for product 103 (column C) in size 120ml (column D). I'm
getting zero as the result every time. Is there an error in the
formula I've entered here? Just for your info, I'm intending to extend
the formula further (by using INDIRECT to reference the formula and
size names) once I've got this correct.
Many thanks for your time,
Paul
> The first part of the formula (A1:A100="X") is in fact a conditional
> statement which will check in turn if A1="X", A2="X", A3="X" etc and
[quoted text clipped - 65 lines]
>
> > - Show quoted text -
Pete_UK - 15 Jan 2008 09:21 GMT
Hi Paul,
no need for the AND, as the * does the same job - you can re-write it
as:
=SUMPRODUCT(($C$6:$C$1000="103")*($D$6:$D$1000="120ml")*($I$6:$I
$1000))
The only other concern I have is whether your product codes are
numbers or text in column C - you might have to write the first bit
as:
($C$6:$C$1000=103)
You can put the values in different cells, eg M1, N1, and then your
formula becomes:
=SUMPRODUCT(($C$6:$C$1000=M1)*($D$6:$D$1000=N1)*($I$6:$I$1000))
This way you can change the values easily without having to change the
formula. Also, if the formula is in cell O1 then you can put other
values in M and N and copy the formula down.
Hope this helps.
Pete
> Ah, thank you for that explanation - now I understand what the formula
> is doing. I obviously simplified the spreadsheet description in my
[quoted text clipped - 86 lines]
>
> - Show quoted text -
paulkaye - 15 Jan 2008 14:51 GMT
That's great - the whole thing works like a charm!
Thank you!
Paul
> Hi Paul,
>
[quoted text clipped - 113 lines]
>
> > - Show quoted text -
Pete_UK - 15 Jan 2008 15:06 GMT
You're welcome, Paul - glad it worked for you.
Pete
> That's great - the whole thing works like a charm!
>
[quoted text clipped - 121 lines]
>
> - Show quoted text -