Lookup and SUM Value from Another Workbook

  • Thread starter Thread starter ken8795
  • Start date Start date
K

ken8795

Pardon my inexperience please but I am looking for what seems would be
fairly simple formula, however have thus far had no luck. I have
workbook that has data saved as follows...

Column C is a TEXT field with a Month/Yr (JAN06, FEB06 etc)
Column D is a TEXT field with a Name
Column E is a NUMERIC field
Column F is a NUMERIC field

The worksheet can contain multiple rows with the same MONTH/YR and/o
NAME.

This file is generated from my billing system. The number of rows i
not static. What I want to do as an example is to SUM the value (E
and or (F) by "Month" (C) (Text) for all with the same name (D) in
single cell within another Workbook.

My intention is to be able to run and save the report from my billin
system and have the separarate worksheet to summarize the data.

Any assistance would be greatly appreciated
 
Hi,


Just adapt the below

Change the text "Book Test.xls" to your workbook name. Also change
Sheet1 if your sheet isn't sheet 1

=SUMPRODUCT(--([BookTest.xls]Sheet1!$C$2:$C$65535="Jan-06")*(--([BookTest.xls]Sheet1!$D$2:$D$65535="John")*(--([BookTest.xls]Sheet1!$E$2:$E$65535)*([BookTest.xls]Sheet1!$F$2:$F$65535))))

VBA Noob
 
Since you mentioned totaling "E and/or F",
how about assigning particular cells to contain your variable criteria.

Say,
G1 = Date (text)
G2 = Name
G3 = E (to sum Column E)
G4 = F (to sum Column F)

And try this formula:

=SUMPRODUCT((C2:C100=G1)*(D2:D100=G2)*((G3="E")*E2:E100+(G4="F")*F2:F100))

You must make sure that G1 and G2 match *exactly* with the data in Columns C
and D.

Either G3 or G4 may be left blank to total only one or the other of the
columns.
 
I just wanted to be sure to thank both of the individuals that responde
to my posting, as both your suggestions were exactly what I needed.
really appreciate the help:
 
Your advice worked perfectly on my test file. I went to use the
function with my real data file and received an error message...

Microsoft Excel

Excel cannot complete this task with available resources. Choose less
data or close other applications.

The only option available is the OK button which closes Excel.

Excel is the only application running. The real data sheet has just
under 8100 rows, so I attempted to reduce the outside range to 8100,
and continue to receive the same error whenever I attempt to enter the
formula in.

The final formula I am using is...

=SUMPRODUCT(--('C:\Documents and Settings\Ken\My
Documents\[producerytd.xls]Sheet1'!$A$2:$A$8100=G4)*(--('C:\Documents
and Settings\Ken\My
Documents\[producerytd.xls]Sheet1'!$M$2:$M$8100=G5)*(--('C:\Documents
and Settings\Ken\My
Documents\[producerytd.xls]Sheet1'!$Q$2:$Q$8100))))

Any Ideas
 
What I would start off doing, would be to put this formula in the *actual*
sheet that the real data was located in, to eliminate all the path info.
Then I would eliminate all the *excess* operators, namely, there's *no* need
for both the double unary and the asterisk.

This would leave the formula on the *real* data sheet (producerytd) as:

=SUMPRODUCT(($A$2:$A$8100=G4)*($M$2:$M$8100=G5)*$Q$2:$Q$8100)

You'd of course have to add the criteria of G4 and G5 to the G4 and G5 of
*this* sheet.

NOW, what do you get with this test?
 
Back
Top