Calculate according to Drop Down control list value

K

K

Hi all, In Range("B7:M7") I have months headings like "APR 08 , MAY
08 …. till MAR 09" and two rows below from these headings in
Range("B10:M22") I have amounts. I also have two drop down controls
on top of the Sheet. Each of those also got months in drop down list
like "APR 08 ..... MAR 09". One cell to right of those drop down
controls i gave heading like to first one i put "FROM" and to second
one i put "TO". "FROM" drop down control result cell is Range("B3")
and "TO" drop down control result cell is Range("D5"). I want macro
on a button that when i select any month in drop down list of those
controls like if i select "APR08" in "FROM" drop down control list and
"AUG 08" in "TO" drop down control list then macro should check those
months and the months between them in Range("B7:M7") headings and SUM
the amounts coming in those months columns in Range("B10:M22") and put
result in Range("O10:O22"). I have uploded my excel file in here
(http://www.savefile.com/files/1872510).
Please see my file for more clear understanding. I'll really
appricate any help from any friend.
 
N

Nigel

In each column total (Column O) put the following formula into row 10 and
copy down to row 22.

=SUMPRODUCT((B$7:M$7>=$C$1)*(B$7:M$7<=$E$1)*(B10:M10))

This will test if the dates in Row 7 are between the date in the cells with
the 'from' and 'to' dates, these are those populated as you change the drop
down list. Since you do not specify which cells; in the formula I used C1
for 'from' and E1 as 'to'. Change these to the specific cells you have used.

NOTE: This is an array formula so when you have typed it in, hold down the
Ctrl-Shift key then press Enter.

--

Regards,
Nigel
(e-mail address removed)



Hi all, In Range("B7:M7") I have months headings like "APR 08 , MAY
08 …. till MAR 09" and two rows below from these headings in
Range("B10:M22") I have amounts. I also have two drop down controls
on top of the Sheet. Each of those also got months in drop down list
like "APR 08 ..... MAR 09". One cell to right of those drop down
controls i gave heading like to first one i put "FROM" and to second
one i put "TO". "FROM" drop down control result cell is Range("B3")
and "TO" drop down control result cell is Range("D5"). I want macro
on a button that when i select any month in drop down list of those
controls like if i select "APR08" in "FROM" drop down control list and
"AUG 08" in "TO" drop down control list then macro should check those
months and the months between them in Range("B7:M7") headings and SUM
the amounts coming in those months columns in Range("B10:M22") and put
result in Range("O10:O22"). I have uploded my excel file in here
(http://www.savefile.com/files/1872510).
Please see my file for more clear understanding. I'll really
appricate any help from any friend.
 

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