Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rck rck is offline
external usenet poster
 
Posts: 3
Default Sum cells based on number of months

What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD data
through july. If I use and index number of say 7 in cell a1 what would the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 Hope this makes sense.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Sum cells based on number of months

This array* formula will do the trick:

=SUM(IF((MOD(COLUMN(C5:Y5),2)=1)*(INT((COLUMN(C5:Y 5)-1)/2)
<=A1),C5:Y5))

* An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correclty then Excel will wrap the formula in curly braces { } when
viewed in the formula bar - do not type these yourself. If you edit
the formula you will need to use CSE again.

Hope this helps.

Pete

On Jul 23, 7:56*pm, rck wrote:
What would the formula be to add 7 months worth of data based on an index.. *
i.e I have 12 cells with data but only want to add say 7 of them for YTD data
through july. *If I use and index number of say 7 in cell a1 what would the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 *Hope this makes sense.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sum cells based on number of months

If this is a YTD total then does that maen there *isn't* any data for Aug
through Dec? Are those cells empty or might they contain a numeric 0?

Your range is every other cell. What's in the cells between? What's in D5,
F5, H5, J5 etc.?

--
Biff
Microsoft Excel MVP


"rck" wrote in message
...
What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD
data
through july. If I use and index number of say 7 in cell a1 what would
the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 Hope this makes sense.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rck rck is offline
external usenet poster
 
Posts: 3
Default Sum cells based on number of months

Here is the actual formula to add 12 months of budgeted data - all cells
contain a number:

=SUM(D40+I40+N40+S40+X40+AC40+AH40+AM40+AR40+AW40+ BB40+BG40)

By putting a value in cell a1 - say 7 for July - How would I modify this to
say add the first 7 cells for July YTD - but leave all 12 cell refereces so
that in August I can change cell A1 to 8 and have it sum 8 months of data?
Thanks in advance.

Bob K.


"T. Valko" wrote:

If this is a YTD total then does that maen there *isn't* any data for Aug
through Dec? Are those cells empty or might they contain a numeric 0?

Your range is every other cell. What's in the cells between? What's in D5,
F5, H5, J5 etc.?

--
Biff
Microsoft Excel MVP


"rck" wrote in message
...
What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD
data
through july. If I use and index number of say 7 in cell a1 what would
the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 Hope this makes sense.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Sum cells based on number of months

Try this variation of the array* formula I gave you yesterday:

=SUM(IF((MOD(COLUMN(D40:BG40)+1,5)=0)*(INT((COLUMN (D40:BG40)+1)/5)
<=A1),D40:BG40))

* An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correclty then Excel will wrap the formula in curly braces { } when
viewed in the formula bar - do not type these yourself. If you edit
the formula you will need to use CSE again.

Hope this helps.

Pete




On Jul 24, 1:48*pm, rck wrote:
Here is the actual formula to add 12 months of budgeted data - all cells
contain a number:

=SUM(D40+I40+N40+S40+X40+AC40+AH40+AM40+AR40+AW40+ BB40+BG40)

By putting a value in cell a1 - say 7 for July - How would I modify this to
say add the first 7 cells for July YTD - but leave all 12 cell refereces so
that in August I can change cell A1 to 8 and have it sum 8 months of data? *
Thanks in advance.

Bob K.



"T. Valko" wrote:
If this is a YTD total then does that maen there *isn't* any data for Aug
through Dec? Are those cells empty or might they contain a numeric 0?


Your range is every other cell. What's in the cells between? What's in D5,
F5, H5, J5 etc.?


--
Biff
Microsoft Excel MVP


"rck" wrote in message
...
What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD
data
through july. *If I use and index number of say 7 in cell a1 what would
the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 *Hope this makes sense.- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rck rck is offline
external usenet poster
 
Posts: 3
Default Sum cells based on number of months

Hi Pete,
Thanks a bunch!! Works perfectly!!! Now if I can only understand the
formula.......

Best Regards,
Bob K.

"Pete_UK" wrote:

Try this variation of the array* formula I gave you yesterday:

=SUM(IF((MOD(COLUMN(D40:BG40)+1,5)=0)*(INT((COLUMN (D40:BG40)+1)/5)
<=A1),D40:BG40))

* An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correclty then Excel will wrap the formula in curly braces { } when
viewed in the formula bar - do not type these yourself. If you edit
the formula you will need to use CSE again.

Hope this helps.

Pete




On Jul 24, 1:48 pm, rck wrote:
Here is the actual formula to add 12 months of budgeted data - all cells
contain a number:

=SUM(D40+I40+N40+S40+X40+AC40+AH40+AM40+AR40+AW40+ BB40+BG40)

By putting a value in cell a1 - say 7 for July - How would I modify this to
say add the first 7 cells for July YTD - but leave all 12 cell refereces so
that in August I can change cell A1 to 8 and have it sum 8 months of data?
Thanks in advance.

Bob K.



"T. Valko" wrote:
If this is a YTD total then does that maen there *isn't* any data for Aug
through Dec? Are those cells empty or might they contain a numeric 0?


Your range is every other cell. What's in the cells between? What's in D5,
F5, H5, J5 etc.?


--
Biff
Microsoft Excel MVP


"rck" wrote in message
...
What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD
data
through july. If I use and index number of say 7 in cell a1 what would
the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 Hope this makes sense.- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Sum cells based on number of months

You're welcome, Bob - thanks for feeding back.

Your data is in every 5th column, starting with the 4th (column D), so
this part of the formula:

(MOD(COLUMN(D40:BG40)+1,5)=0)

sets up a condition to take data only from those columns by adding 1
to the column number (to make it 5, 10, 15 etc) and then dividing by 5
and taking the value only when the remainder is zero.

The next part of the formula:

(INT((COLUMN(D40:BG40)+1)/5)<=A1)

ensures that data is taken only from those column blocks which are
less than or equal to the index in cell A1.

Both these conditions have to be met for the data to be summed to give
you the result.

Hope this helps.

Pete

On Jul 24, 3:42*pm, rck wrote:
Hi Pete,
Thanks a bunch!! *Works perfectly!!! *Now if I can only understand the
formula.......

Best Regards,
Bob K.



"Pete_UK" wrote:
Try this variation of the array* formula I gave you yesterday:


=SUM(IF((MOD(COLUMN(D40:BG40)+1,5)=0)*(INT((COLUMN (D40:BG40)+1)/5)
<=A1),D40:BG40))


* An array formula has to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual Enter. If you do this
correclty then Excel will wrap the formula in curly braces { } when
viewed in the formula bar - do not type these yourself. If you edit
the formula you will need to use CSE again.


Hope this helps.


Pete


On Jul 24, 1:48 pm, rck wrote:
Here is the actual formula to add 12 months of budgeted data - all cells
contain a number:


=SUM(D40+I40+N40+S40+X40+AC40+AH40+AM40+AR40+AW40+ BB40+BG40)


By putting a value in cell a1 - say 7 for July - How would I modify this to
say add the first 7 cells for July YTD - but leave all 12 cell refereces so
that in August I can change cell A1 to 8 and have it sum 8 months of data? *
Thanks in advance.


Bob K.


"T. Valko" wrote:
If this is a YTD total then does that maen there *isn't* any data for Aug
through Dec? Are those cells empty or might they contain a numeric 0?


Your range is every other cell. What's in the cells between? What's in D5,
F5, H5, J5 etc.?


--
Biff
Microsoft Excel MVP


"rck" wrote in message
...
What would the formula be to add 7 months worth of data based on an index.
i.e I have 12 cells with data but only want to add say 7 of them for YTD
data
through july. *If I use and index number of say 7 in cell a1 what would
the
formula be to add only the first 7 cells listed out of 12 cells -
c5,e5,g5,i5,k5,m5,o5,q5,s5,u5,w5,y5 *Hope this makes sense.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
how to hide a number of cells based on one cell? TG Excel Discussion (Misc queries) 11 June 26th 09 08:15 PM
calculate number of months based on one date JK Excel Discussion (Misc queries) 1 March 5th 09 05:51 PM
Excel for calculating stock cover based on a number of months sale DubaiGeorge Excel Worksheet Functions 2 November 1st 07 05:21 PM
How do I number columns based on adjacent cells? johnjesmer Excel Worksheet Functions 1 October 18th 06 02:36 AM
count number of cells based on TWO conditions (2 different columns Troi-Xanh Excel Worksheet Functions 2 February 12th 05 12:46 AM


All times are GMT +1. The time now is 11:08 PM.

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

About Us

"It's about Microsoft Excel"