View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Sum a range based on another range of cells

Hi Raj

The below formula would return 1 result
=SUMIF(A2:A10,F2,B2:B10))

The below would return an array of results. In this case 3 results. Array
enter the below formula selecting 3 cells (if the range is F2:F4)
=SUMIF(A2:A10,F2:F4,B2:B10)

'And SUMPRODUCT does the rest..which is to sum the results.
=SUMPRODUCT(SUMIF(A2:A10,F2:F4,B2:B10))


If this post helps click Yes
---------------
Jacob Skaria


"Raj" wrote:

Hi Jacob Skaria,

Thanks, Dude.

It really works. My problem is resolved with your answer.

But one thing I didn't know is that how did you solve this. I cannot get
the formula logic. I thought "Sumif" can be given only for one criteria.
And "Sumproduct" can be used only for multiplication of a range of values to
another range of values. But your answer was simply amazing.

I would be grateful to you for the solution.

And one more request to you, can you please tell me about its working logic
i.e. how does it work with combination of Sumproduct with Sumif. (atleast in
this case)

Hoping that you will reply me with the way it works.

Thankfully,

Raj

"Jacob Skaria" wrote:

Hi Raj

Try the below formula

A2:B10 is your data
F2:F4 is the range 2

=SUMPRODUCT(SUMIF(A2:A10,F2:F4,B2:B10))

If this post helps click Yes
---------------
Jacob Skaria


"Raj" wrote:

I want to sum a range based on another range of cells. I can detail my
problem as follows:

Range: 1
Name Points
A 1
B 2
C 3
D 4
E 5

Range: 2

Name
B
C
E


My intention is to sum the corresponding values of Range: 2 in Range: 1.

In another words to sum the values corresponding to B, C and E which would
be 10.

The main problem is the second range i.e. Range: 2 may change. I want to
have a solution for this.

Please send to my e-mail ID : if you can solve this.
Please, please and please help me.