ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Limelight Media - ExcelTip.com Books > F1 Get the most out of Excel Formulas & Functions

Notices

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-25-2007, 05:00 PM
steven21 steven21 is offline
Registered User
 
Join Date: 25 Jan 2007
Posts: 4
steven21 is on a distinguished road
Adding in increments

I am hoping someone could help me. I am trying to figure out a formula that will add the 5th cell in each row of a Spreadsheet I have, currently I have =J5+O5+T5+Z5+...+IO5, but I am needing to add lots more values and I do not want to have to keep updating the formula.

I have asked a few people I know but no one can seem to help.

Is there an IF statement I can use and specify the cell I want it to go upto?

Please help
Reply With Quote
  #2  
Old 01-25-2007, 05:03 PM
VBA Noob's Avatar
VBA Noob VBA Noob is online now
Wicked Forum Moderator
 
Join Date: 25 Apr 2006
Location: London, England
Posts: 11,003
VBA Noob will become famous soon enough VBA Noob will become famous soon enough
Hi,

This site might help

http://www.cpearson.com/excel/excelF.htm#SumEveryNth


VBA Noob
__________________
_________________________________________


Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters

Please remember to wrap code.

Forum Rules

Please add to your signature if you found this link helpful. Excel links !!!
Reply With Quote
  #3  
Old 01-25-2007, 05:12 PM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
Posts: 4,979
daddylonglegs will become famous soon enough daddylonglegs will become famous soon enough
Not sure about your example.....

=J5+O5+T5+Z5+...+IO5

wouldn't it be Y5.....and IP5


....but you could do it similar to Chip's way but with SUMPRODUCT, thus avoiding CSE.....i.e.

=SUMPRODUCT(--(MOD(COLUMN(J5:IV5)-COLUMN(J5),5)=0),J5:IV5)
Reply With Quote
  #4  
Old 01-25-2007, 06:11 PM
steven21 steven21 is offline
Registered User
 
Join Date: 25 Jan 2007
Posts: 4
steven21 is on a distinguished road
Quote:
Originally Posted by daddylonglegs
Not sure about your example.....

=J5+O5+T5+Z5+...+IO5

wouldn't it be Y5.....and IP5


....but you could do it similar to Chip's way but with SUMPRODUCT, thus avoiding CSE.....i.e.

=SUMPRODUCT(--(MOD(COLUMN(J5:IV5)-COLUMN(J5),5)=0),J5:IV5)
I have given both a go and I either get 0 or 224, not sure what I am doing wrong. the cells I want to add are defintely J5, O5, T5 and so on, so maybe it is not going up in 5
Reply With Quote
  #5  
Old 01-25-2007, 06:14 PM
steven21 steven21 is offline
Registered User
 
Join Date: 25 Jan 2007
Posts: 4
steven21 is on a distinguished road
Is it ok if I can ask someone to have a look at it? I have uploaded it to a zip file
Attached Files
File Type: zip stats.zip (97.7 KB, 33 views)
Reply With Quote
  #6  
Old 01-25-2007, 06:48 PM
VBA Noob's Avatar
VBA Noob VBA Noob is online now
Wicked Forum Moderator
 
Join Date: 25 Apr 2006
Location: London, England
Posts: 11,003
VBA Noob will become famous soon enough VBA Noob will become famous soon enough
You have to sort you table out

E.g delete Column X and AM. Didn't check past that.

Formula works just your data not consistant

VBA Noob
__________________
_________________________________________


Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters

Please remember to wrap code.

Forum Rules

Please add to your signature if you found this link helpful. Excel links !!!
Reply With Quote
  #7  
Old 01-26-2007, 09:53 AM
steven21 steven21 is offline
Registered User
 
Join Date: 25 Jan 2007
Posts: 4
steven21 is on a distinguished road
I have deleted the blank columns but I am still not sure if its correct - for example I know cell G32 should be 2, but its showing 0.

=SUMPRODUCT(--(MOD(COLUMN(J5:IO5)-COLUMN(J5),5)=0),J5:IO5)

is the formula
Attached Files
File Type: zip Revised Stats.zip (99.7 KB, 26 views)
Reply With Quote
  #8  
Old 01-26-2007, 10:28 AM
VBA Noob's Avatar
VBA Noob VBA Noob is online now
Wicked Forum Moderator
 
Join Date: 25 Apr 2006
Location: London, England
Posts: 11,003
VBA Noob will become famous soon enough VBA Noob will become famous soon enough
Data layout still wrong

Column CU should be GP but is G.

Will work if you check the data

Enter a blank row and add this formula in I2 and drag across

=IF(MOD(COLUMN()-8,5)=0,5,(MOD(COLUMN()-8,5)))

G should always equal 2

VBA Noob
__________________
_________________________________________


Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters

Please remember to wrap code.

Forum Rules

Please add to your signature if you found this link helpful. Excel links !!!
Reply With Quote
  #9  
Old 01-26-2007, 10:33 AM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
Posts: 4,979
daddylonglegs will become famous soon enough daddylonglegs will become famous soon enough
Rather than trying to sum every 5th column it should be easier to use SUMIF based on your column headers

I’m not sure exactly which formulas you’re referring to but try this formula in C5 on u19’s worksheet

=SUMIF($I$4:$IO$4,C$4,$I5:$IO5)

copy across to column G and then down
Reply With Quote
Reply

Bookmarks

New topics in F1 Get the most out of Excel Formulas & Functions


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


All times are GMT -4. The time now is 05:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0