relative vs complet reference

M

moshe

the folowing function
function sumrange(r as range,c)
dim c as variant
for each c in r
if c>0 then
sumrange = c/worksheetfunction.sum(r)
sumrange= format(sumrange,"##,##.00")
next c
end function
is an attempt to calulate for each cell in a range ,the
ratio between the cell & the total value of the range.
my question- how can i program the function to create
absolute reference to the range i choose,without using the
f4 button.
thanks
 
B

BrianB

I don't see your logic here because the code you have written is not
workable. If you just want to know the proportional value of the whole
it does not matter if the range contains zeros or not. It would be
different if you wanted an average to exclude zero values.

There would seem to be no need to make a custom function because your
need would be covered by copying down the column something like :-

=A1/SUM($A$1:$A$10)



Regards
BrianB
============================================================
 

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