View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveDB1 SteveDB1 is offline
external usenet poster
 
Posts: 414
Default Sumproduct issues

Roger,
Here is a sample of actual formula, and data.
=sumproduct((Map!$F$4:$F$30=$C3 )*(Map!$E$4:$E$30=$A3)*(Map$B$3:$B$30))
Map! is the worksheet name
Column F = John Doe, Sam Jack, etc.... (all names of clients)
Column C = same names as Col. F. It however is on another sheet, and is
searching data on that sheet
Column E = 5 digit numeric values (we classify these as "general" format.
These are permit #'s. I say general format because we just want plain numbers
with no decimal places.)
Column A = same permit #'s as in E. (Same as in C. The data being searched
is on another worksheet.)
Column B is acreage values.
This is a Civil Engineering application, tracking ownership of land, and
water rights.
As mentioned initially it worked really well in the beginning. After a few
weeks it began to become finicky.
To give some more info, I've saved the general form of the equation into an
*.xlt template in my template directory. I adjust the row range for the
specific worksheet length.
And finally, I've even deleted columns, cleared formatting, etc... to wipe
out any possible corruption that may have defiled the file I work with.
I can open a workbook that has never used the formula, and it may, or may
not work there. One of the engineers even did a test before he started using
it, and tried a variety of values. He was unable to get it to work. I just
applied it to my worksheet set, and found it to work immediately. It was only
later that it began not working sporadically. Now I'm working on one workbook
in which any of the values with a permit number return a 0.
I get that what I'm asking is for the routine to search the column F range
on the Map worksheet, and compare it to the data in cell C3 on the other
worksheet. IF that data exists, it will return a true, or 1. It then looks
through all of the data in the Column E range on the Map worksheet, and
compares it to the data in cell A3. If the data is there, it returns a true,
or 1. If the data is NOT there, it returns a false, or 0. OR, if the data is
in one of the cells, and not the other, it will then return false, or 0. For
the values that are both true, it will return a true, or 1, and then add the
third column set to return a total value.
Thus giving me a dataset comparable to
true*true*4.5 = 4.5
true*false*2.3 = 0
false*false*2.1 = 0
false*true*1.2 = 0
true*true*6.5 = 6.5
total = 11.00
Let me know if you need more.


"Roger Govier" wrote:

Hi Steve
Post your actual formula, and a sample of what data appears in the
column you are testing against cell a, what data is being tested against
cell b and what data exists in Final.

--
Regards

Roger Govier


"SteveDB1" wrote in message
...
Hi folks.
I use sumproduct to sum columns of values after testing against 2
criteria.
At first it was working great, and then it stopped working once one
cell
that I was testing against had a value in it. It's actually become
quite
finicky. It'd work in some cases, but not in others.
My version of sumproduct is:
=sumproduct((Col&RowRange = cell a)*(Col&RowRange = cell
b)*(Col&RowRangeFinal))
Where Col&RowRange would be a column, and range of rows; cell a, and
cell b
would be the values that I'm looking for; and the Col&RowRangeFinal
would be
the column that I'm summing up.

I have to ask-- would this be affected by cell formatting? (I've gone
so far
as to copy and paste cell values from the source regions to the final
regions, and it still only works sometimes.) If so, why? It'd be
really nice
to know, so I can ensure consistency, and continuity.
what else would cause this to fail?
Oh, and I did try the comma's instead of *'s as shown in the office
assistant help file. That killed everything with no sign of errors, or
#ref,
value, etc....-- i.e., I just got 0.000 for the returned value.

Thus far, aside from this issue, it's been a real godsend, so I'd hate
to be
forced to use something else to solve my reasons for using it to begin
with.