View Single Post
  #6   Report Post  
Harlan Grove
 
Posts: n/a
Default

"dshigley" wrote...
I did a search on my question before I posted and one of last years answers
was the exact same thing. I tried that formula but cannot seem to get it

to
work. Thanks though.

....

In what way does the formula not work? It does work if you've given correct
specs and have ensured your data range contains no leading or trailing
spaces in the entries in columns A and B and all entries are numbers rather
than text looking like numbers in column C.

"Duke Carey" wrote:
Try

=sumproduct(--(A2:A100="Bob"),--(B2:B100="Red"),C2:C100)

....

Basic formula debugging. What do the formulas

=COUNTIF(A2:A100,"Bob")
=SUMPRODUCT(--(TRIM(A2:A100)="Bob"))
=SUMPRODUCT(--(TRIM(SUBSTITUTE(A2:A100,CHAR(168),""))="Bob"))

=COUNTIF(B2:B100,"Red")
=SUMPRODUCT(--(TRIM(B2:B100)="Red"))
=SUMPRODUCT(--(TRIM(SUBSTITUTE(B2:B100,CHAR(168),""))="Red"))

=SUM(C2:C100)
=SUMPRODUCT(--C2:C100)

return? If the first 3 and/or second 3 return different results, you have
either normal ASCII or nonbreaking HTML spaces in your columns A and/or B.
If the last two formulas return different results, some or all of your
column C values are text. The most robust formula would be

=SUMPRODUCT(--(TRIM(SUBSTITUTE(A2:A100,CHAR(168),""))="Bob"),
--(TRIM(SUBSTITUTE(B2:B100,CHAR(168),""))="Red"),--C2:C100)

However, the best approach would be to clean up the data in A2:C100.