SUMPRODUCT

M

Mark Allen

I am trying to re-create a spreadsheet into a single file where previously I
was linking to another but I am now having problems.

Original code:
=SUMPRODUCT(('No Prospects.xls'!$D$1:$D$10000=$A$3)*('No
Prospects.xls'!$G$1:$G$10000=A19))

Returns a value of 2

New code:
=SUMPRODUCT((Data!$C$1:$C$10000=$A$3)*(Data!$L$1:$L$10000=A19))

Returns a value of 0 !!!!! should be 2

I know the cell range has changed i.e. D to C and G to L but this
should not matter.

The data in "Data" sheet comes direct from a SQL database where previously
it came from a CSV file.

It has something to do with the format coming in from the database. If I go
to the data in column L double click on one item and then press enter the
data now moves to the left !

I don't understand ?

Please help as this is really frustrating !!!!

Mark
 
B

Barb Reinhardt

Try something like this then

=SUMPRODUCT(--(A1:A10=B1),--(S2:S10 = T1))

HTH,

Barb Reinhardt

(Many of us review several Excel newsgroups. Multiposting is not necessary)
 
M

Mark Allen

No, still the same.

What I don't get is why when I double click on the cell in the DATA sheet I
then press the enter key the contents of the cell move to the right (if a
number) and then the formula works.

However if it has got TEXT in the Cell it works fine...

Mark
 
J

JMB

The numbers in your data are text. A text "1" is not equal to a 1 formatted
as a number. Maybe format A19 as text so that everything is a text
comparison.

Also see your other post for a means to coerce the numbers in your data to
actual numeric values.
 
J

JMB

The numbers in your data are most likely text. A text "1" is not equal to a
1 formatted as a number. Maybe format A19 as text so that everything is a
text comparison?

Also see your other post for a means to coerce the numbers in your data to
actual numeric values.
 
B

Barb Reinhardt

Maybe something like this would work then:

=SUMPRODUCT(--(TEXT(A1:A10)=TEXT(B1)),--(TEXT(S1:S10)=TEXT(T1)))

I know it's a bandaid.
 
J

JMB

I get "too few arguments" error. Perhaps:

=SUMPRODUCT(--(TEXT(A1:A10,"General")=TEXT(B1,"General")),--(TEXT(S1:S10,"General")=TEXT(T1,"General")))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top