rookie needs a macro...

D

Denise

Colum H - rows 5-42 contain various positive and negative
number

I need... sum of all negative numbers in the column to
appear in H44
I need ....sum of all positive numbers in the column to
appear in H45

How do I enter the macro in the worksheet?

Thanks very much!!
 
K

Kevin Stecyk

Hi Denise,

I think you meant you need a formula.

H44

=Sumif(H5:H42, "<0")

H45

=Sumif(H5:H42, ">=0")

Hope that helps.

Regards,
Kevin
 
D

Don Guillett

You shouldn't need a macro. Take a look in HELP index for SUMIF worksheet
function.
 
B

Bob Phillips

Denise,

A worksheet function does it

H44: =SUMIF(H5:H42,"<"&0)

H45: =SUMIF(H5:H42,">"&0)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
D

Dave R.

Don't need a macro for this, try the SUMIF function, it does exactly what
you like.
 
C

CLR

Dunno about a macro, but this can be easily done with formulas........

in H44 put =SUMIF(H5:H42,"<0")
in H54 put =SUMIF(H5:H42,">0")

and if you want the total number of each, rather than the sums,

for the negative numbers, use =COUNTIF(H5:H42,"<0")
and the positive numbers, use =COUNTIF(H5:H42,">0")

hth
Vaya con Dios,
Chuck, CABGx3
 
C

CLR

You' re more than welcome Denise.........thanks for the thanks, and keep
coming back.....

Vaya con Dios,
Chuck, CABGx3
 

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