#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Sumproduct

I have two conditions I need to sum on 2 different worksheets:

Worksheet1
Column A2
John Doe

Worksheet2
Column A2 Column B2 Column C2
John Doe 1 2
John Smith 2

I need to:
If A2:A100 in Worksheet2 = columnA in Worksheet1
and
column B in Worksheet2 <1
Sum up Column C in worksheet1 in B2, otherwise 0

So in this instance B2: John Doe would be 0, but John Smith would be 2.

I hope I haven't made it too confusing. Please help.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Sumproduct

If the data in each sheet begins on row 2.
=SUMPRODUCT(--(Sheet2!$A$2:$A$30=Sheet1!A2),--(Sheet2!$B$2:$B$30<1),Sheet2!$C$2:$C$30)
Of course , the 30 can be changed to whatever; but you cannot us a whole
column reference such as A:A (except, I think, with XL 2007)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"jhicsupt" wrote in message
...
I have two conditions I need to sum on 2 different worksheets:

Worksheet1
Column A2
John Doe

Worksheet2
Column A2 Column B2 Column C2
John Doe 1 2
John Smith 2

I need to:
If A2:A100 in Worksheet2 = columnA in Worksheet1
and
column B in Worksheet2 <1
Sum up Column C in worksheet1 in B2, otherwise 0

So in this instance B2: John Doe would be 0, but John Smith would be 2.

I hope I haven't made it too confusing. Please help.

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Sumproduct

Can you provide some more detail about what you're looking to do?
Specifically, when you say "IF A2:a100 in Worksheet 2 = column A in worksheet
1", it's not clear WHAT you want to test: sum, count, product, average?

Same with your second test "column B in Worksheet2 < 1": 1 what? One
count? The value of 1? An average of 1?

Dave
--
Brevity is the soul of wit.


"jhicsupt" wrote:

I have two conditions I need to sum on 2 different worksheets:

Worksheet1
Column A2
John Doe

Worksheet2
Column A2 Column B2 Column C2
John Doe 1 2
John Smith 2

I need to:
If A2:A100 in Worksheet2 = columnA in Worksheet1
and
column B in Worksheet2 <1
Sum up Column C in worksheet1 in B2, otherwise 0

So in this instance B2: John Doe would be 0, but John Smith would be 2.

I hope I haven't made it too confusing. Please help.

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default Sumproduct

Thanks for quick response.

Heres what Im trying to do.

I have two worksheets.

Sheet1
A2 A3
John Doe this is where I want the result of the formula

Sheet2
Column A Column B Column C
John Doe 1 5
John Smith 5

All of the employees are listed in Sheet1. So I want to check Sheet2 for
multiple criteria.

First I need to find John Doe in Sheet2. If John Doe is on Sheet2 A50, then
check Sheet2 A51.
If Sheet2 A51=1, then no need to go any further, enter a 0 in Sheet1 A3.
If Sheet2 A51<1, then go to Sheet2 A52 and see if theres a 5.
If theres a 5, in Sheet1 A3, put a 5.
If theres not a 5, in Sheet1 A3, put a 0.

Hopefully this is still not too confusing.

Here what I have, but it's returning VALUE
=SUMPRODUCT(--(DailyAttendance!A4:A631=ASA!A4),--(DailyAttendance!M4:M631<1),--([ASALog.xls]ASAInput!$C$4=5),5,"")




=SUMPRODUCT(--(DailyAttendance!A4:A631=ASA!A4),--(DailyAttendance!M4:M631<1),--([ASALog.xls]ASAInput!$C$4=5),5,"")

"Bernard Liengme" wrote:

If the data in each sheet begins on row 2.
=SUMPRODUCT(--(Sheet2!$A$2:$A$30=Sheet1!A2),--(Sheet2!$B$2:$B$30<1),Sheet2!$C$2:$C$30)
Of course , the 30 can be changed to whatever; but you cannot us a whole
column reference such as A:A (except, I think, with XL 2007)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"jhicsupt" wrote in message
...
I have two conditions I need to sum on 2 different worksheets:

Worksheet1
Column A2
John Doe

Worksheet2
Column A2 Column B2 Column C2
John Doe 1 2
John Smith 2

I need to:
If A2:A100 in Worksheet2 = columnA in Worksheet1
and
column B in Worksheet2 <1
Sum up Column C in worksheet1 in B2, otherwise 0

So in this instance B2: John Doe would be 0, but John Smith would be 2.

I hope I haven't made it too confusing. Please help.

Thanks.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
Need help with sumproduct and dynamic ranges Bill_S Excel Worksheet Functions 2 March 19th 06 01:19 AM
Sumproduct Peter B Excel Worksheet Functions 1 March 7th 05 01:59 PM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


All times are GMT +1. The time now is 01:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"