ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   search or vlookup help (https://www.excelbanter.com/excel-programming/375865-search-vlookup-help.html)

Little Penny[_2_]

search or vlookup help
 
I'm trying to get excel lookup a value and than search for that value
in a column and then return the value two columns to the right. I know
this sound like vlookup but I want excel to continue looking after it
finds the first instance of my lookup value because there maybe 3 or 4
instance of my lookup value that have different values two columns to
the right. How can I do this and what function should I use if possible.


Don Guillett

search or vlookup help
 
you can do this with vlookup by expanding your range and just using the
column desired
OR
you can use match to find the row and put that in an index formula
or
use offset

--
Don Guillett
SalesAid Software

"Little Penny" wrote in message
oups.com...
I'm trying to get excel lookup a value and than search for that value
in a column and then return the value two columns to the right. I know
this sound like vlookup but I want excel to continue looking after it
finds the first instance of my lookup value because there maybe 3 or 4
instance of my lookup value that have different values two columns to
the right. How can I do this and what function should I use if possible.




Little Penny[_2_]

search or vlookup help
 
But as I understand it vlookup will only return the first instance of a
lookup value.
For example If I do a vlookup in column A for the word DOG and return
the value 3 columns to the right and DOG is in Colum A in rows 3,5, and
7 and in column C row 3 is the word RED, and column C row 5 is the word
WHITE and column C row 7 is the word BLUE. The way vlookup works it
will only return the word RED, I want it to return RED, WHITE and BLUE.

Is this not correct?








Don Guillett wrote:
you can do this with vlookup by expanding your range and just using the
column desired
OR
you can use match to find the row and put that in an index formula
or
use offset

--
Don Guillett
SalesAid Software

"Little Penny" wrote in message
oups.com...
I'm trying to get excel lookup a value and than search for that value
in a column and then return the value two columns to the right. I know
this sound like vlookup but I want excel to continue looking after it
finds the first instance of my lookup value because there maybe 3 or 4
instance of my lookup value that have different values two columns to
the right. How can I do this and what function should I use if possible.



Bob Phillips

search or vlookup help
 
=INDEX(C1:C100,MAX(IF(A1:A100="Bob",ROW(A1:A100))) )

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Little Penny" wrote in message
ups.com...
But as I understand it vlookup will only return the first instance of a
lookup value.
For example If I do a vlookup in column A for the word DOG and return
the value 3 columns to the right and DOG is in Colum A in rows 3,5, and
7 and in column C row 3 is the word RED, and column C row 5 is the word
WHITE and column C row 7 is the word BLUE. The way vlookup works it
will only return the word RED, I want it to return RED, WHITE and BLUE.

Is this not correct?








Don Guillett wrote:
you can do this with vlookup by expanding your range and just using the
column desired
OR
you can use match to find the row and put that in an index formula
or
use offset

--
Don Guillett
SalesAid Software

"Little Penny" wrote in message
oups.com...
I'm trying to get excel lookup a value and than search for that value
in a column and then return the value two columns to the right. I know
this sound like vlookup but I want excel to continue looking after it
finds the first instance of my lookup value because there maybe 3 or 4
instance of my lookup value that have different values two columns to
the right. How can I do this and what function should I use if

possible.





Little Penny[_2_]

search or vlookup help
 

A B C

1 CAT CAT GREEN
2 CAT CAT YELLOW
3 DOG CAT RED
4 CAT CAT ORANGE
5 DOG CAT WHITE
6 CAT CAT BLACK
7 DOG CAT BLUE

Thanks Bop for you rely. I modified your formula for the above example

=INDEX(C1:C100,MAX(IF(A1:A100="DOG",ROW(A1:A100))) )

I only get "BLUE" not "RED WHITE AND BLUE". I also made sure to use
Ctrl-Shift-Enter. How do I combine these value in to one cells or over
serveral cell.















Bob Phillips wrote:
=INDEX(C1:C100,MAX(IF(A1:A100="Bob",ROW(A1:A100))) )

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Little Penny" wrote in message
ups.com...
But as I understand it vlookup will only return the first instance of a
lookup value.
For example If I do a vlookup in column A for the word DOG and return
the value 3 columns to the right and DOG is in Colum A in rows 3,5, and
7 and in column C row 3 is the word RED, and column C row 5 is the word
WHITE and column C row 7 is the word BLUE. The way vlookup works it
will only return the word RED, I want it to return RED, WHITE and BLUE.

Is this not correct?








Don Guillett wrote:
you can do this with vlookup by expanding your range and just using the
column desired
OR
you can use match to find the row and put that in an index formula
or
use offset

--
Don Guillett
SalesAid Software

"Little Penny" wrote in message
oups.com...
I'm trying to get excel lookup a value and than search for that value
in a column and then return the value two columns to the right. I know
this sound like vlookup but I want excel to continue looking after it
finds the first instance of my lookup value because there maybe 3 or 4
instance of my lookup value that have different values two columns to
the right. How can I do this and what function should I use if

possible.




Bob Phillips

search or vlookup help
 
Sorry, thought you wanted the last.

I can get them all in separate cells

Select say D1:d20, and in the formula bar, enter

=IF(ISERROR(SMALL(IF($A$1:$A$20="DOG",ROW($A1:$A20 ),""),ROW($A1:$A20))),"",
INDEX($C$1:$C$20,SMALL(IF($A$1:$A$20="DOG",ROW($A1 :$A20),""),ROW($A1:$A20)))
)

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

You can concatenate then with

=D1&" " &D2&" " &D3&" " &D4&" " &D5

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Little Penny" wrote in message
ps.com...

A B C

1 CAT CAT GREEN
2 CAT CAT YELLOW
3 DOG CAT RED
4 CAT CAT ORANGE
5 DOG CAT WHITE
6 CAT CAT BLACK
7 DOG CAT BLUE

Thanks Bop for you rely. I modified your formula for the above example

=INDEX(C1:C100,MAX(IF(A1:A100="DOG",ROW(A1:A100))) )

I only get "BLUE" not "RED WHITE AND BLUE". I also made sure to use
Ctrl-Shift-Enter. How do I combine these value in to one cells or over
serveral cell.















Bob Phillips wrote:
=INDEX(C1:C100,MAX(IF(A1:A100="Bob",ROW(A1:A100))) )

which is an array formula, it should be committed with Ctrl-Shift-Enter,

not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Little Penny" wrote in message
ups.com...
But as I understand it vlookup will only return the first instance of

a
lookup value.
For example If I do a vlookup in column A for the word DOG and return
the value 3 columns to the right and DOG is in Colum A in rows 3,5,

and
7 and in column C row 3 is the word RED, and column C row 5 is the

word
WHITE and column C row 7 is the word BLUE. The way vlookup works it
will only return the word RED, I want it to return RED, WHITE and

BLUE.

Is this not correct?








Don Guillett wrote:
you can do this with vlookup by expanding your range and just using

the
column desired
OR
you can use match to find the row and put that in an index formula
or
use offset

--
Don Guillett
SalesAid Software

"Little Penny" wrote in message
oups.com...
I'm trying to get excel lookup a value and than search for that

value
in a column and then return the value two columns to the right. I

know
this sound like vlookup but I want excel to continue looking after

it
finds the first instance of my lookup value because there maybe 3

or 4
instance of my lookup value that have different values two columns

to
the right. How can I do this and what function should I use if

possible.






Little Penny

search or vlookup help
 
A B C

1 CAT CAT GREEN
2 CAT CAT YELLOW
3 DOG CAT RED
4 CAT CAT ORANGE
5 DOG CAT WHITE
6 CAT CAT BLACK
7 DOG CAT BLUE


E7=IF(ISERROR(SMALL(IF($A$1:$A$20="DOG",ROW($A1:$A 20),""),ROW($A1:$A20))),"",INDEX($C$1:$C$20,SMALL( IF($A$1:$A$20="DOG",ROW($A1:$A20),""),ROW($A1:$A20 ))))


Hey Bob if I copy and Paste your formula in cell E1. I only get red.
Should I paste the formula in three different cell to get red white
and blue. I little confused.



Thanks for your held.

Bob Phillips

search or vlookup help
 
Little Penny,

Don't put the formula in E1, select E1:E20, add the formula to the formula
bar, and then Ctrl-Shift-Enter it.

It is a block array formula, it applies to an array of cells, so must be
enter as one block.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Little Penny" wrote in message
...
A B C

1 CAT CAT GREEN
2 CAT CAT YELLOW
3 DOG CAT RED
4 CAT CAT ORANGE
5 DOG CAT WHITE
6 CAT CAT BLACK
7 DOG CAT BLUE



E7=IF(ISERROR(SMALL(IF($A$1:$A$20="DOG",ROW($A1:$A 20),""),ROW($A1:$A20))),""
,INDEX($C$1:$C$20,SMALL(IF($A$1:$A$20="DOG",ROW($A 1:$A20),""),ROW($A1:$A20))
))


Hey Bob if I copy and Paste your formula in cell E1. I only get red.
Should I paste the formula in three different cell to get red white
and blue. I little confused.



Thanks for your held.





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com