Sum data in workbook 1 and write result in workbook 2

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,

I need some help with excel macro!
I have two workbooks. Now I need to sum all cells with some date criteria
from first workook
and result must be inserted in cell in second workbook (for example in cell
A1)

WorkBook1 data example

Column B (dates) Column C (payroll)
12.05.2005 1200
12.05.2005 5000
14.05.2005 3100
14.05.2005 8800
17.05.2005 3550
....


For example: sum all values in column C where date in column B is 12.05.2005
and put result in workbook 2 in cell A1

Thanks for help.
 
Martin

You don't need a macro, just a formula. If the data is in book1.xls and you
want the answer in book2.xls, the formula would be something like.

=SUMIF([Book1]Sheet1!$A$1:$A$11,[Book1]Sheet1!$A$1,[Book1]Sheet1!$B$1:$B$11)

To work this, enter the =SUMIF(

in book2 and then select the dates in book1, type a comma and then select
the date you are using as the criteria or type it in "". then enter a comma
and select the data you are wanting to sum

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 

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