Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Totalling x no of cols

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Totalling x no of cols

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)

wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Totalling x no of cols

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
match identical cols aquaflow Excel Discussion (Misc queries) 0 July 11th 08 04:46 PM
2 Cols To 2 Cols VLookup Comparison CuriousMe Excel Discussion (Misc queries) 4 December 21st 06 07:54 PM
Cond Format:re color 2 cols, skip 2 cols Tat Excel Worksheet Functions 2 June 22nd 05 06:43 PM
referencing cols in functions - NPV DesM Excel Worksheet Functions 3 June 9th 05 09:36 AM
Format Cols Brent E Excel Worksheet Functions 2 April 29th 05 02:46 AM


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"