Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
z.entropic
 
Posts: n/a
Default combining VLOOKUP and IF

I'm trying to get around the problem of VLOOKUP looking up only the first
found match. Here's and example:

Each row in the first worksheet has a unique value in the first column
(file_ID), and a variable number of the same file_ID entries in consecutive
row blocks in the second worksheet. Now, I'd like to extract to the first
worksheet the corresponding values in, let's say, column 5 in the second
worksheet IF the column 3 value in that 2nd worksheet meets a certain
condition. The values in column 3 are unique for each file_ID entry.

I couldnt solve the problem with various combinations of VLOOKUP and IF and
suspect that an array formula would be needed--but I don't know how to bite
it...

z.entropic


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

In E1: =SUMPRODUCT(--(Sheet2!E1:E1000=the_val),--(Sheet2!A1:A1000=A1))

not really sure about the req so it is a bit of a guess.

--
HTH

Bob Phillips

"z.entropic" wrote in message
...
I'm trying to get around the problem of VLOOKUP looking up only the first
found match. Here's and example:

Each row in the first worksheet has a unique value in the first column
(file_ID), and a variable number of the same file_ID entries in

consecutive
row blocks in the second worksheet. Now, I'd like to extract to the first
worksheet the corresponding values in, let's say, column 5 in the second
worksheet IF the column 3 value in that 2nd worksheet meets a certain
condition. The values in column 3 are unique for each file_ID entry.

I couldnt solve the problem with various combinations of VLOOKUP and IF

and
suspect that an array formula would be needed--but I don't know how to

bite
it...

z.entropic




  #3   Report Post  
z.entropic
 
Posts: n/a
Default

Thanks, but I'm not sure if I follow your advice and formula. Here's a
clearer example and description of the problem:

For matching values a, b, c in Sheet_1!A and Sheet_2!A, copy into Sheet1_!B
the values in Sheet_2!C only IF Sheet_2!B=2.

columns
A B C
--------start_sheet_1-----------
a X
b X
c X
--------end_sheet_1-----------

--------start_sheet_2-----------
a 1 x
a 2 x
a 3 x

b 1 x
b 2 x
b 3 x

c 1 x
c 2 x
c 3 x
--------end_sheet_2-----------


"Bob Phillips" wrote:

In E1: =SUMPRODUCT(--(Sheet2!E1:E1000=the_val),--(Sheet2!A1:A1000=A1))

not really sure about the req so it is a bit of a guess.

--
HTH

Bob Phillips

"z.entropic" wrote in message
...
I'm trying to get around the problem of VLOOKUP looking up only the first
found match. Here's and example:

Each row in the first worksheet has a unique value in the first column
(file_ID), and a variable number of the same file_ID entries in

consecutive
row blocks in the second worksheet. Now, I'd like to extract to the first
worksheet the corresponding values in, let's say, column 5 in the second
worksheet IF the column 3 value in that 2nd worksheet meets a certain
condition. The values in column 3 are unique for each file_ID entry.

I couldnt solve the problem with various combinations of VLOOKUP and IF

and
suspect that an array formula would be needed--but I don't know how to

bite
it...

z.entropic





  #4   Report Post  
Ola
 
Posts: n/a
Default

Try this Array formula:
=INDEX($C$1:$C$100,MATCH(A1&"2",(Sheet_2!$A$1:$A$1 00&Sheet_2!$B$1:$B$100),0))

Ola Sandstrom

Note:
Confirm the formula by holding down Ctrl and Shift, and then press Enter.
Othervise the result will be #VALUE!
If there is no match the formula will return #N/A. Then use
IF(ISERROR(...),"",...)

  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

That should probably be

=INDEX(Sheet_2!$C$1:$C$100,MATCH(A1&"2",(Sheet_2!$ A$1:$A$100&Sheet_2!$B$1:$B
$100),0))

--
HTH

Bob Phillips

"Ola" wrote in message
...
Try this Array formula:

=INDEX($C$1:$C$100,MATCH(A1&"2",(Sheet_2!$A$1:$A$1 00&Sheet_2!$B$1:$B$100),0)
)

Ola Sandstrom

Note:
Confirm the formula by holding down Ctrl and Shift, and then press Enter.
Othervise the result will be #VALUE!
If there is no match the formula will return #N/A. Then use
IF(ISERROR(...),"",...)





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
Vlookup finds a blank, but returns a zero - HELP! flummoxed Excel Discussion (Misc queries) 6 January 18th 05 03:15 PM
Vlookup Syntax Error YV New Users to Excel 9 December 23rd 04 05:28 PM
VLOOKUP not working Scott Excel Worksheet Functions 3 November 12th 04 08:06 PM
Using Cell references in VLookUp JonWilson631 Excel Worksheet Functions 1 November 4th 04 02:49 AM
vlookup. Amit Excel Worksheet Functions 2 November 3rd 04 12:34 PM


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

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

About Us

"It's about Microsoft Excel"