View Single Post
  #36   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur[_2_] Ashish Mathur[_2_] is offline
external usenet poster
 
Posts: 1,766
Default How do I set up a formula to add column a if column b = cell c

Hi,

Try this

=sumproduct((B2:B500=C1)*(C2:C5001)*(C2:C500<2)*( A2:A500))

The formula above will sum up all the numbers in A2:A50 which meets the
three criteria mentioned above

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"iami" wrote in message
...
Hello!
This really helped,but I got another problem. What if I have multiple
criteria? For example my criteria is a range, like if value in this column
is
between 1 and 2 or "1 and <2", how do you go about that? I tried writing
it
like that but it doesn't come up with the correct answer. any help is
greatly
appreciated. thanks!

"Max" wrote:

"michelle" wrote:
The thing is, I need a formula that looks at everything in the columns,
not
just the cell in that row. Is this even possible?


Perhaps you mean something like this, placed in D1:
=SUMIF(B:B,C1,A:A)

Formula can be copied down
to return correspondingly for other values in col C
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---