Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
giantwolf
 
Posts: n/a
Default Combination of H & Vlookup??


Hi,

I have a query which I don't think can be solved by the use of either h
or vlookup, I'm thinking a combination of both but I guess this doesn't
exist.

I have a list of codes and these need to be looked up against a table
where each code appears in the same column as the value I want to
return. eg

code1
value
value2

code2
value
value2

code3
value
value2

In each instance I would want to go down the list and return the number
that appears in "value" directly under the corresponding code in this
list when it is looked for from my lookup list. I don't think hlookup
would work because I need to find each code below another rather than
across and v lookup wouln't work because I need to find a value below
rather than in an ajoining column. Any ideas?


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=394140

  #2   Report Post  
Krishnakumar
 
Posts: n/a
Default


Hi,

Try,

If your data are in A1:A10 then,

=INDEX($A$2:$A$10,MATCH(C2,$A$2:$A$10,0)+1)

where C2 houses the code

HTH


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile: http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=394140

  #3   Report Post  
Max
 
Posts: n/a
Default

One play ..

Assuming data below is in col A, from row1 down

code1
111
112

code2
222
223

code3
333
334

etc

(Code#'s are assumed unique and the data structure is assumed regular)

Let's reserve B1 & C1 for inputs of the code# and the number of the value to
be returned, i.e. a "1" to return the 1st value beneath or a "2" to return
the 2nd value beneath the row with the matching code.

Put in B1, say: code2
Put in C1, say: 2

Put in D1:

=IF(OR(B1="",C1=""),"",IF(ISNA(MATCH(B1,A:A,0)),"N o matching
code",INDEX(A:A,MATCH(B1,A:A,0)+C1)))

D1 would return the required result, viz.: 223

Unmatched codes, if any, will return the alert: No matching code
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"giantwolf" wrote
in message ...

Hi,

I have a query which I don't think can be solved by the use of either h
or vlookup, I'm thinking a combination of both but I guess this doesn't
exist.

I have a list of codes and these need to be looked up against a table
where each code appears in the same column as the value I want to
return. eg

code1
value
value2

code2
value
value2

code3
value
value2

In each instance I would want to go down the list and return the number
that appears in "value" directly under the corresponding code in this
list when it is looked for from my lookup list. I don't think hlookup
would work because I need to find each code below another rather than
across and v lookup wouln't work because I need to find a value below
rather than in an ajoining column. Any ideas?


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile:

http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=394140



  #4   Report Post  
giantwolf
 
Posts: n/a
Default


Krishnakumar Wrote:
Hi,

Try,

If your data are in A1:A10 then,

=INDEX($A$2:$A$10,MATCH(C2,$A$2:$A$10,0)+1)

where C2 houses the code

HTH



Superb, thanks!


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=394140

  #5   Report Post  
giantwolf
 
Posts: n/a
Default


Max Wrote:
One play ..

Assuming data below is in col A, from row1 down

code1
111
112

code2
222
223

code3
333
334

etc

(Code#'s are assumed unique and the data structure is assumed regular)

Let's reserve B1 & C1 for inputs of the code# and the number of the
value to
be returned, i.e. a "1" to return the 1st value beneath or a "2" to
return
the 2nd value beneath the row with the matching code.

Put in B1, say: code2
Put in C1, say: 2

Put in D1:

=IF(OR(B1="",C1=""),"",IF(ISNA(MATCH(B1,A:A,0)),"N o matching
code",INDEX(A:A,MATCH(B1,A:A,0)+C1)))

D1 would return the required result, viz.: 223

Unmatched codes, if any, will return the alert: No matching code
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"giantwolf"
wrote
in message
...

Hi,

I have a query which I don't think can be solved by the use of either

h
or vlookup, I'm thinking a combination of both but I guess this

doesn't
exist.

I have a list of codes and these need to be looked up against a

table
where each code appears in the same column as the value I want to
return. eg

code1
value
value2

code2
value
value2

code3
value
value2

In each instance I would want to go down the list and return the

number
that appears in "value" directly under the corresponding code in

this
list when it is looked for from my lookup list. I don't think

hlookup
would work because I need to find each code below another rather

than
across and v lookup wouln't work because I need to find a value

below
rather than in an ajoining column. Any ideas?


--
giantwolf

------------------------------------------------------------------------
giantwolf's Profile:

http://www.excelforum.com/member.php...o&userid=24718
View this thread:

http://www.excelforum.com/showthread...hreadid=394140


Thanks to both of you, they both do exactly what I wanted. Cheers.


--
giantwolf
------------------------------------------------------------------------
giantwolf's Profile: http://www.excelforum.com/member.php...o&userid=24718
View this thread: http://www.excelforum.com/showthread...hreadid=394140



  #6   Report Post  
Max
 
Posts: n/a
Default

You're welcome !
Thanks for the feedback ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"giantwolf" wrote:
....
Thanks to both of you, they both do exactly what I wanted. Cheers



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 Limitations chris_manning Excel Worksheet Functions 2 August 9th 05 06:23 PM
combination of vlookup and match question Nelson Excel Worksheet Functions 3 June 24th 05 08:18 AM
Have Vlookup return a Value of 0 instead of #N/A Mr Mike Excel Worksheet Functions 4 May 25th 05 04:51 PM
Array Function with VLOOKUP CoRrRan Excel Worksheet Functions 15 April 8th 05 05:54 PM
vlookup data hidden within worksheet Excel Worksheet Functions 0 January 26th 05 12:09 PM


All times are GMT +1. The time now is 12:44 AM.

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"