Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Returning cell value if 2 criteria are met

I'm struggling with a SUMPRODUCT

I have two worksheets (WS1 and WS2) both with the following columns:
'Material Number' (Column A) and 'Site' (Column B). They each have around
9000 rows. In WS2 there is another value, 'Group' (Column C)

If the a Material and Site combination from WS1 are found in WS2, return the
Group in WS2:Column C to Column C in WS1.

Any ideas?


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,696
Default Returning cell value if 2 criteria are met

=SUMPRODUCT(--(WS2!$A$2:$A$10000=A2),--(WS2!$B$2:$B$10000=B2),--(WS2!$C$2:$C$10000))

If you merely select A:A, it chockes. Must be a range.

"D Zandveld" wrote:

I'm struggling with a SUMPRODUCT

I have two worksheets (WS1 and WS2) both with the following columns:
'Material Number' (Column A) and 'Site' (Column B). They each have around
9000 rows. In WS2 there is another value, 'Group' (Column C)

If the a Material and Site combination from WS1 are found in WS2, return the
Group in WS2:Column C to Column C in WS1.

Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 33
Default Returning cell value if 2 criteria are met

Thanks Sean, but i'm just getting '0'.

There are definitely ones to find.

Any other ideas, cell formatting etc. to consider?

"Sean Timmons" wrote:

=SUMPRODUCT(--(WS2!$A$2:$A$10000=A2),--(WS2!$B$2:$B$10000=B2),--(WS2!$C$2:$C$10000))

If you merely select A:A, it chockes. Must be a range.

"D Zandveld" wrote:

I'm struggling with a SUMPRODUCT

I have two worksheets (WS1 and WS2) both with the following columns:
'Material Number' (Column A) and 'Site' (Column B). They each have around
9000 rows. In WS2 there is another value, 'Group' (Column C)

If the a Material and Site combination from WS1 are found in WS2, return the
Group in WS2:Column C to Column C in WS1.

Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Returning cell value if 2 criteria are met

Any other ideas, cell formatting etc. to consider?

If you're handling mixed data, try the array-entered* index/match option

In WS1, in C2, array-entered*:
=INDEX(WS2!$C$2:$C$10000,MATCH(1,(WS2!$A$2:$A$1000 0=A2)*(TRIM(WS2!$B$2:$B$10000)=TRIM(B2)),0))
*Press CTRL+SHIFT+ENTER

Above also uses TRIM for more robust matching to shake out the possible
extraneous white spaces in either/both the source col B in WS2 and the lookup
value in B2 which would otherwise throw apparent matches off
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:18,100 Files:360 Subscribers:56
xdemechanik
---
  #5   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Returning cell value if 2 criteria are met

Any other ideas, cell formatting etc. to consider?

Another play*, normal ENTER will do (no need to array-enter):
=INDEX(WS2!$C$2:$C$10000,MATCH(1,INDEX((WS2!$A$2:$ A$10000=A2)*(TRIM(WS2!$B$2:$B$10000)=TRIM(B2)),),0 ))

*idea inspired by a couple of Teethless Mama's recent postings
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:18,100 Files:360 Subscribers:56
xdemechanik
---
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
Returning a value in one cell based on the criteria of another cel Kirstin Excel Worksheet Functions 2 May 17th 08 01:24 AM
Returning all values based on 2 criteria... Kevin Excel Discussion (Misc queries) 7 December 31st 07 07:17 AM
MULTIPLE CRITERIA RETURNING SUM OF RESULTS [email protected] Excel Worksheet Functions 5 November 15th 06 06:21 PM
MULTIPLE CRITERIA RETURNING SUM OF RESULTS [email protected] Excel Worksheet Functions 0 November 15th 06 05:11 PM
returning blank cell in criteria o Joop Excel Discussion (Misc queries) 3 June 3rd 05 02:11 PM


All times are GMT +1. The time now is 10:22 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"