Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to hide a number of cells based on one cell? | Excel Discussion (Misc queries) | |||
calculate number of months based on one date | Excel Discussion (Misc queries) | |||
Excel for calculating stock cover based on a number of months sale | Excel Worksheet Functions | |||
How do I number columns based on adjacent cells? | Excel Worksheet Functions | |||
count number of cells based on TWO conditions (2 different columns | Excel Worksheet Functions |