What Function to use

N

Newsweek

Hi

I am quite a novice with MSExcel but have managed to achieve some success
with formulas and formatting even between worksheets.

However I am struggling with the following problem and would appreciate some
advice.

I have two columns, each of thirty cells, Column J will contain either the
letter C or the letter P and column K will contain an amount.

I want cell D37 to contain the total of only the cells in column K where the
corresponding cells in column J equals "P" and likewise
I want cell D38 to contain the total of only the cells in column K where the
corresponding cells in column J equals "C".

Hope I have explained this ok.

Many thanks, Rob
 
J

joeu2004

Newsweek said:
I have two columns, each of thirty cells, Column J will contain either the
letter C or the letter P and column K will contain an amount.

I want cell D37 to contain the total of only the cells in column K where the
corresponding cells in column J equals "P" and likewise
I want cell D38 to contain the total of only the cells in column K where the
corresponding cells in column J equals "C".

Hope I have explained this ok.

Perfectly! Try, for example:

=SUMIF(J:J,"P",K:K)

Replace "J:J" and "K:K" with the appropriate subrange,
if you did not mean the entire column literally.
 
G

Gord Dibben

Rob

By total, I assume "SUM"

=SUMIF(J1:J30,"=p",K1:K30) in D37

=SUMIF(J1:J30,"=c",K1:K30) in D38


Gord Dibben Excel MVP
 
N

Newsweek

Many thanks to both of you for your very speedy and successful answer to my
problem.

I can now stop scratching my head.

Thanks again, Rob
 

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