Totalling rows

M

Muruk

I have a table of 12 columns of numbers reflecting the expenses of depts for
the year. e.g.

Jul Aug ...........May Jun Total
Dept 1 100 120 130 90 1230
Dept 2 200 202 240 195 2600
Dept 3

At the end of each month I wish to have the total reflect only the months
remaining to the end of the year. e.g. at the end of Aug, the formula in the
total colum would only add from Sept to Jun.

Can anyone assist with the formula I need to use??

Thank You
 
C

CLR

You might try giving each of your months a code number, such as July=1,
aug=2, etc up to June=12, then use a SUMIF formula with condition of
"greater than" whatever month you're interested in..........

Vaya con Dios,
Chuck, CABGx3
 
B

Biff

Hi!

First, I like Chuck's idea!

Not sure what you mean by this:
At the end of each month I wish to have the total reflect
only the months remaining to the end of the year.

What if it isn't the end of a month? Does that mean you
only want the total for the next month to the end of the
fiscal year? If that's the case:

Assume the depts are in col A.
Jul, Aug, Sept etc are in the range B1:M1

=SUM(OFFSET(B2,0,MATCH(TEXT(TODAY(),"mmm"),B1:M1,0),1,12-
MATCH(TEXT(TODAY(),"mmm"),B1:M1,0)))

See why I like Chuck's idea!

Biff
 
M

Muruk

Chuck,


CLR said:
You might try giving each of your months a code number, such as July=1,
aug=2, etc up to June=12, then use a SUMIF formula with condition of
"greater than" whatever month you're interested in..........

Vaya con Dios,
Chuck, CABGx3
 
M

Muruk

Chuck,
thanks for the feedback, the use of the SUMIF formula seems to work. However
I would like the criteria in the SUMIF formula to refer to a cell which
contains a number between 1 and 12. I want the formula to sum anything
greater than the number in the cell e.g. SUMIF(range,">a1", sumrange). A1 in
this example is the cell containing the number that refers to the month.
Anyhow, it does not seem to like ">a1", if I take the quotes off I get a zero
value.

Any further thoughts.

Muruk
 
M

Muruk

Phew Biff my head is spinning.

Yes I think that Chucks idea is fine.

If I understand your formula correctly you are using today to determine the
month. Unfortunately this is an accounting exercise which deals with
historical data. E.G. Although it is now December I still want to calculate
the numbers from Dec to Jun.

Thank you for taking the time to respond.
 
M

Max

Just another option to try ..

Assume the depts are in col A.
with B1:M1 containing dates*: Jul-04, Aug-04,.. Jun-05
*"1st of month" dates in "mmm-yy" format filled across,
i.e. entered in B1: Jul-04 (Actual value is: 01-Jul-2004),
B1 filled across to M1

and with "Total" in N1

Put in N2:

=SUM(INDIRECT(CHAR(MATCH(DATE(YEAR(TODAY()),MONTH(TODAY()),1),$B$1:$M$1,0)+6
6)&ROW()&":M"&ROW()))

Copy down
 
B

Biff

Hi!
Although it is now December I still want to calculate the
numbers from Dec to Jun.

OK, just a minor modification:

=SUM(OFFSET(B2,0,MATCH(TEXT(TODAY(),"mmm"),B1:M1,0)-1,1,12-
MATCH(TEXT(TODAY(),"mmm"),B1:M1,0)+1))

Biff
 
M

Muruk

Biff,
Spot on, it works a charm. WE also found that by leaving the criteria as A1
and placing the > sign in front of the number in A1 it also worked. E.G. A1
shows >5.

However I think your solution is cleaner in that I only have to change the
number in one cell.

Many thanks
 

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

Top