Sum based on two selections - months

S

Sunnyskies

Afternoon from Sunny RSA,

I have a table - Jul (Column P) to Jun (Column AA) with values in each
column for applicable month.
Each row has information pertaining to an event i.e volumes delivered in row
13
Now I have two drop downs with the months listed. In cell D5 = Jul and Cell
F5 = Sep
Now I need a formula that will go to the table, find Jul and use as the
starting point, now go and find the month selected in F5 (in this case Sep)
and sum the values between the two month to give me a Year To Date value in
cell J13.

Thanks in advance for your answer.
 
J

Joel

Try this. I assuming your mean by Between to add July, August, and
September. I'm not using the table heders instead using an offset based on
the Month Number. I am converting each month name into a Serial Date
(1-Jul-08) and getting the month number. Ijust am using the offset function
and computing the column based on the first month Jul being in column P.

=SUM(OFFSET(P13,0,MOD(MONTH(DATEVALUE("1-"&D5&"-2008"))-7,12),1,MOD(MONTH(DATEVALUE("1-"&F5&"-2008"))-6,12)))
 
S

Sunnyskies

Thanks Joel will test.

Joel said:
Try this. I assuming your mean by Between to add July, August, and
September. I'm not using the table heders instead using an offset based on
the Month Number. I am converting each month name into a Serial Date
(1-Jul-08) and getting the month number. Ijust am using the offset function
and computing the column based on the first month Jul being in column P.

=SUM(OFFSET(P13,0,MOD(MONTH(DATEVALUE("1-"&D5&"-2008"))-7,12),1,MOD(MONTH(DATEVALUE("1-"&F5&"-2008"))-6,12)))
 

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