View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Billigmeier David Billigmeier is offline
external usenet poster
 
Posts: 176
Default VLOOKUP, SUMPRODUCT, or SUMIF?

Unfortunately SUMPRODUCT() won't work on full columns, you have to end the
reference at row 65535... but this will work:

=SUMPRODUCT(--(Data!$H$1:$H$65535=A1),--(Data!$G$1:$G$65535="P"),Data!$M$1:$M$65535)

Then, for the 65536th row you can add just a simple check:

+if(and(Data!$H$65536=A1,Data!$G$65536="P"),Data!$ M$65536,0)


--
Regards,
Dave


"steph" wrote:

I believe there is any easy solution to my problem but after a few hours of
trying I just havent hit on it yet€¦hope someone else can.

I have 2 worksheets titled €śdata€ť and €śjobs€ť.
I need to lookup a value from the €śjobs€ť worksheet on the €śdata€ť worksheet
(col H). If I find the value in H, I need to sum the value of col M from the
€śdata€ť worksheet where the rows had a match on col H. So far, so good.
However, I only want to sum the rows with a value of €śP€ť in col G. Here is
my example:

Data
Col G Col H Col M
P ABC123 100
P DEF456 150
D GHI789 200
D GHI789 250
P GHI789 300
P GHI789 350

Jobs
Col A Col B
ABC123 100
DEF456 150
GHI789 650

Ive tried various ways around this but keep getting the full total of
GHI789 = 1100. Ive also tried
=VLOOKUP(A2,data!H2:H1911,SUMPRODUCT((data!$G$2:$G $65536="P")*(data!$M$2:$M$65536))) but this gives me a #REF error. Am I close??

--
Thanks so much!