A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Returning cell value if 2 criteria are met



 
 
Thread Tools Display Modes
  #1  
Old September 22nd, 2008, 11:02 PM posted to microsoft.public.excel.newusers
D Zandveld
external usenet poster
 
Posts: 7
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  
Old September 22nd, 2008, 11:11 PM posted to microsoft.public.excel.newusers
Sean Timmons
external usenet poster
 
Posts: 1,722
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  
Old September 22nd, 2008, 11:23 PM posted to microsoft.public.excel.newusers
D Zandveld
external usenet poster
 
Posts: 7
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  
Old September 23rd, 2008, 12:00 AM posted to microsoft.public.excel.newusers
Max
external usenet poster
 
Posts: 8,574
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  
Old September 23rd, 2008, 01:02 AM posted to microsoft.public.excel.newusers
Max
external usenet poster
 
Posts: 8,574
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
---
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:59 AM.


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