ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with lookup code (https://www.excelbanter.com/excel-programming/331583-help-lookup-code.html)

browie

Help with lookup code
 
Which lookup code do I use for the following

On a worksheet I have a row starting with a particular number, what I need
to do is for excel to look for the exact match to the number in the range
"a10:a20", When it finds the match in need the code to copy the entire row
to that number in the range?

some thing like this

a b c d e
1 10
2 11
3 12
4 13
5 14
6 15

13 alpha beta charlie delta echo

if I have 13 in cell "a35" I would like it to copy like this

a b c d e f
1 10
2 11
3 12
4 13 alpha beta charlie delta echo
5 14
6 15


Hope anyone can help

Thanks

Browie




K Dales[_2_]

Help with lookup code
 
If the list of lookup values is sorted, you can use VLOOKUP. Just use a
slightly different value in each column, e.g. for column B (assuming row 2,
and using LookupTable to stand for your table of lookup values):
=VLOOKUP($A2,LookupTable,2,0)
For column C:
=VLOOKUP($A2,LookupTable,3,0)
and so on...

If not sorted you can use MATCH and OFFSET in the form
=OFFSET(LookupTable,MATCH($A1,LookupTableColumnA,0 )-1,1,1,1)
apply this similarly in each column changing only the 3rd parameter from the
end, which tells how many columns over to read the data from.

"browie" wrote:

Which lookup code do I use for the following

On a worksheet I have a row starting with a particular number, what I need
to do is for excel to look for the exact match to the number in the range
"a10:a20", When it finds the match in need the code to copy the entire row
to that number in the range?

some thing like this

a b c d e
1 10
2 11
3 12
4 13
5 14
6 15

13 alpha beta charlie delta echo

if I have 13 in cell "a35" I would like it to copy like this

a b c d e f
1 10
2 11
3 12
4 13 alpha beta charlie delta echo
5 14
6 15


Hope anyone can help

Thanks

Browie






All times are GMT +1. The time now is 05:32 PM.

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