Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ainsley
 
Posts: n/a
Default Sum a range of columns ?


I have a simple budget with columns for each month (month 1 to 12) and a
Year to Date column at the end.

If it is now say month 3, how do I get my YTD column to just add up the
first three columns. I have a cell that tells me what month we are in,
so I can use this in the formula, but I cant think of how to write the
formula that adds up this specified number of columns.

I want somthing that says it is now month 'x', so add up months 1 to
'x'. Each time I put in the month number, I want to see the YTD sum
without changing that formula.

Any help will be appreciated.

Regards, AB


--
Ainsley
------------------------------------------------------------------------
Ainsley's Profile: http://www.excelforum.com/member.php...o&userid=31960
View this thread: http://www.excelforum.com/showthread...hreadid=539848

  #2   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Sum a range of columns ?

You can use indirect for achieving this. Suppose that we have the month data
in column B (B1:B12), and the cell where you want to enter the moving month
is C1. You can enter this formula is C2, for example:
="B1:B" & C1
And then in B13 (or wherever fits)
=SUM(INDIRECT(C2))

Hope this helps,
Miguel.

"Ainsley" wrote:


I have a simple budget with columns for each month (month 1 to 12) and a
Year to Date column at the end.

If it is now say month 3, how do I get my YTD column to just add up the
first three columns. I have a cell that tells me what month we are in,
so I can use this in the formula, but I cant think of how to write the
formula that adds up this specified number of columns.

I want somthing that says it is now month 'x', so add up months 1 to
'x'. Each time I put in the month number, I want to see the YTD sum
without changing that formula.

Any help will be appreciated.

Regards, AB


--
Ainsley
------------------------------------------------------------------------
Ainsley's Profile: http://www.excelforum.com/member.php...o&userid=31960
View this thread: http://www.excelforum.com/showthread...hreadid=539848


  #3   Report Post  
Posted to microsoft.public.excel.misc
Ainsley
 
Posts: n/a
Default Sum a range of columns ?


Hi, Im not sure I understand.

I have in Column A Jan data, Column B Feb data and so on to Dec in
Column L. The a Column M which is to be the sum of several of these
months, depending upon a number in a seperate cell. This being the
month number we are in.

Jan being month 1, Feb being month 2 and so on to Dec being month 12.

So if it is currently month 5, I want my Year to Date Column to sum
columns Jan to May simply by me inputting a 5 in a cell say above my
YTD column.

What formula do I use to achive this ?


--
Ainsley
------------------------------------------------------------------------
Ainsley's Profile: http://www.excelforum.com/member.php...o&userid=31960
View this thread: http://www.excelforum.com/showthread...hreadid=539848

  #4   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Sum a range of columns ?

Hi,

I have made the assumtion that the data was in rows, not in columns.
The idea behind the formula is craft dinamically a range name (for example
A2:E2) and then sum the data on this range. We use INDIRECT to achieve this.
In this case, if you have the cell where you want to enter the month in P1,
the formula to use in the M column can be:
=SUM(INDIRECT("A"& ROW(A2) & ":" &ADDRESS(ROW(A2),$P$1)))
This is for cell M2, you can copy this formula over the column.

Hope this helps,
Miguel.

"Ainsley" wrote:


Hi, Im not sure I understand.

I have in Column A Jan data, Column B Feb data and so on to Dec in
Column L. The a Column M which is to be the sum of several of these
months, depending upon a number in a seperate cell. This being the
month number we are in.

Jan being month 1, Feb being month 2 and so on to Dec being month 12.

So if it is currently month 5, I want my Year to Date Column to sum
columns Jan to May simply by me inputting a 5 in a cell say above my
YTD column.

What formula do I use to achive this ?


--
Ainsley
------------------------------------------------------------------------
Ainsley's Profile: http://www.excelforum.com/member.php...o&userid=31960
View this thread: http://www.excelforum.com/showthread...hreadid=539848


  #5   Report Post  
Posted to microsoft.public.excel.misc
Ainsley
 
Posts: n/a
Default Sum a range of columns ?


Hi, thanks for that. Ive used it but cant get it to work exactly all
situations.

If my data starts in Column E (for Jan) and ends in Column P (Dec) and
the YTD is in Column T and the month number in Column V I cant seem to
make the formula work. The data all starts on row 11.

I also cant seem to copy it to other rows downward.

Ive typed
=SUM(INDIRECT("E"& ROW(E11) & ":" &ADDRESS(ROW(E11),$V$11)))

But its not working. What am i doing wrong ?


--
Ainsley
------------------------------------------------------------------------
Ainsley's Profile: http://www.excelforum.com/member.php...o&userid=31960
View this thread: http://www.excelforum.com/showthread...hreadid=539848



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
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM
VLookup Error in Part of a Named Range Dallas64 Excel Worksheet Functions 6 April 18th 06 02:13 PM
want sumif function's range to evaluate 2 columns Debgala Excel Worksheet Functions 7 November 6th 05 03:46 AM
Array to named range conversion... i-Zapp Excel Discussion (Misc queries) 4 October 25th 05 09:09 PM
extract data from a range of cells in rows or columns when a date. Dartyon Excel Worksheet Functions 0 February 24th 05 10:37 PM


All times are GMT +1. The time now is 09:30 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"