Help with countif function

D

David Goodall

Hi
I've created a very simple formula using countif.

=(COUNTIF('Sheet1'!$D$4:$D$4000,1))

Adjacent to column A where "1" appears I have a another number which I would
like to find a total for.


Column A Column D

1 10
2 5
3 2
1 15
2 23
4 1
5 12

So in this case 1's total would be 25 and it appears twice which I have
determined from the countif function.

Hope this makes sense.

Many thanks
David
 
N

Norman Harker

Hi David!

Try:

=SUMIF(Sheet1!$A$4:$A$4000,1,Sheet1!$D$4:$D$4000)

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
K

Ken Wright

You just need SUMIF not COUNTIF

=sumif(range,criteria,sum_range)

range = A4:A4000
criteria = 1
sum_range = D4:D4000
 
D

David Goodall

Many thanks

Ken Wright said:
You just need SUMIF not COUNTIF

=sumif(range,criteria,sum_range)

range = A4:A4000
criteria = 1
sum_range = D4:D4000

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

-------------------------------------------------------------------------- --
It's easier to beg forgiveness than ask permission :)
-------------------------------------------------------------------------- --
 

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