Totalling x no of cols

A

annysjunkmail

I am trying total x no of cols based on the following conditions.

Cols to count: =WebsiteScores!J1
Starting col: =WebsiteScores!O3
End col: =WebsiteScores!O4

Using the following grid as an example on sheet 1,

A B C D E F G
1 1 2 3 5 6 7

J1=3
O3=1
04=4

which means produce total of 3 cols (J1) starting at colA and end at
ColD. Total is therefore 7.

I have the following formula on which totals the cols selected by J1
but does not account for the variable starting and ending cols.

=SUM(OFFSET($L2,0,1,1,WebsiteScores!$J$1))

Can someone help?

Thanks
Tony
 
B

Bob Phillips

3 columns starting at A is C, not D.

O4 is irrelevant, as by having the start and number of columns, the end
column is derivable.

The amended formula is

=SUM(OFFSET($L2,0,WebsiteScores!$O$3-1,1,WebsiteScores!$J$1))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
A

annysjunkmail

Excellent Bob,
struggled with this for ages and it's exactly what I was looking for.
Thanks
Tony
 

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