sum problem

  • Thread starter Thread starter Mark Reid
  • Start date Start date
M

Mark Reid

Hi all

i just cant find the answer to this. i have a rows of data with a sum at the
end of each row
i wish to calculate the sum based on which month i am currently in

ie if i am in month 5 then just add up 5 cells etc


Current month = 4
Month 1 Month 2 Month 3 Month 4 Month 5 Sum to current month
1 2 3 4 5 Sum( a1 to
current Month)

by changing the value of current month the sum will automatically change

all help much appreciated

ta
 
Try something like this:

For Months in cells A1:L1
A1: Jan, B1: Feb, ....L1: Dec

The current month number in N1
N1: 5

The cummulative total in N2 of months 1 through the value in N1 is:
N2: =SUMPRODUCT((COLUMN($A:$L)<=N1)*A2:L2)

Note: if your data starts in a column other than Col_A you'd need to add a
value to the N1 reference to compensate.

Post again if you encounter issues.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top