Sum of specific cells

G

Guest

How do I return a sum of a range of cells corresponding to a certain criteria

(For example: I want the sum of all cells in A column which have a value in
B colomn:

A B
1 A
3 B
6

- I only want the sum of cells a1, a2 = 4)

Thanks.
 
A

Aladin Akyurek

=SUMIF(B1:B3,"<>",A1:A3)
How do I return a sum of a range of cells corresponding to a certai
criteria

(For example: I want the sum of all cells in A column which have
value in
B colomn:

A B
1 A
3 B
6

- I only want the sum of cells a1, a2 = 4)

Thanks
 
P

Pierre Leclerc

Hi

Welcome to the amazing univers of SUMPRODUCT

=SUMPRODUCT((b1:b50>2)*(A1:A50))
In plain English, sum cells A1 to A50 if in the corresponding cell of
B1 to B50 the value is greater than 2

=SUMPRODUCT((b1:b50<>"")*(A1:A50))
In plain English, sum cells A1 to A50 if in the corresponding cell of
B1 to B50 there is something

This is SUMPRODUCT with one criteria but you can have as many criteria
as you need...depending on a value in columns B, C, D, E, F......

See the site below

http://www.excel-vba.com


or
{=SUM(IF(B1:B3>"",A1:A3,0))}

to cover when b3=6

Steve

Pierre Leclerc
http://www.excel-vba.com
(e-mail address removed)
 
A

Aladin Akyurek

Steve said:
=SUMIF(B1:B3,"<>",A1:A3)

or
{=SUM(IF(B1:B3>"",A1:A3,0))}

to cover when b3=6

You seem to think that "a value" should be restricted to letters/text
If so, you need something different than what you suggest for it fail
to exclude B3 = TRUE or include B3 housing a formula blank, etc.
 

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