S
schwammrs
Hi all--
I'm using this formula:
=SUMPRODUCT(--(Date>=B1),--(Date<E1),--(Category=A5),--(Out))
where Date, Category and Out are named ranges containing date values,
category names and dollar values respectively. So essentially, I'm adding
up all the "Out" values that fall within a certain date range and are equal
to a certain category.
If I set the ranges to be only the first 25 or 50 or so rows (all have data
in them), I get the total I expect.
If I set the ranges to be the last 25 or 50 or so rows (all are empty), I
get nothing, also as expected.
Here's where I start to be confused:
If I set the ranges to be the entire list of 700 rows, I get #VALUE. Huh?
Even if I set the ranges to just the first 300 rows (some with data, some
empty), I get #VALUE.
And even more confusin, if I remove the double unary from the Out part, e.g.
=SUMPRODUCT(--(Date>=B1),--(Date<E1),--(Category=A5),Out)
then it doesn't matter if the ranges are the first 25 or the last 25 or all
700 rows; I get the correct result, not #VALUE.
By the way, if I used actual ranges, e.g. S3:S703 instead of named ranges,
the same thing happens; using the double unary on all four components
sometimes gives me a #VALUE result whereas removing the double unary from
the fourth component (the only one that's a number already, not a condition)
is always correct.
Any ideas why this is happening. Obviously, I can just remove the double
unary to get my spreadsheet to work, but I don't like not understanding why
the first way doesn't always work. Obviously, I need the double unary (or
some other thing like 0+, etc) on the conditions to force them to be
numbers, and I don't NEED to use a double unary on something that's already
a number, but wouldn't a double unary in front of a number just keep it the
same number?
Thanks for any insight,
Karin
Excel2000
I'm using this formula:
=SUMPRODUCT(--(Date>=B1),--(Date<E1),--(Category=A5),--(Out))
where Date, Category and Out are named ranges containing date values,
category names and dollar values respectively. So essentially, I'm adding
up all the "Out" values that fall within a certain date range and are equal
to a certain category.
If I set the ranges to be only the first 25 or 50 or so rows (all have data
in them), I get the total I expect.
If I set the ranges to be the last 25 or 50 or so rows (all are empty), I
get nothing, also as expected.
Here's where I start to be confused:
If I set the ranges to be the entire list of 700 rows, I get #VALUE. Huh?
Even if I set the ranges to just the first 300 rows (some with data, some
empty), I get #VALUE.
And even more confusin, if I remove the double unary from the Out part, e.g.
=SUMPRODUCT(--(Date>=B1),--(Date<E1),--(Category=A5),Out)
then it doesn't matter if the ranges are the first 25 or the last 25 or all
700 rows; I get the correct result, not #VALUE.
By the way, if I used actual ranges, e.g. S3:S703 instead of named ranges,
the same thing happens; using the double unary on all four components
sometimes gives me a #VALUE result whereas removing the double unary from
the fourth component (the only one that's a number already, not a condition)
is always correct.
Any ideas why this is happening. Obviously, I can just remove the double
unary to get my spreadsheet to work, but I don't like not understanding why
the first way doesn't always work. Obviously, I need the double unary (or
some other thing like 0+, etc) on the conditions to force them to be
numbers, and I don't NEED to use a double unary on something that's already
a number, but wouldn't a double unary in front of a number just keep it the
same number?
Thanks for any insight,
Karin
Excel2000