ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   vlookup (https://www.excelbanter.com/excel-discussion-misc-queries/245522-vlookup.html)

puiuluipui

vlookup
 
Hi, i have this situation:
database sheet:
C D E F G
den ref cod gr price
mask ch09 0838 2 3.4

Work sheet:
C D E F G
den ref cod gr price

The code will be in C2.
In D2 i will select ch09 from dropdown, and a cell back, in C2 i need the
code to retrieve mask. If i select another "ref" in D, then the code to
retrieve corresponding data from database sheet
Can this be done?
Thanks!

smartin

vlookup
 
puiuluipui wrote:
Hi, i have this situation:
database sheet:
C D E F G
den ref cod gr price
mask ch09 0838 2 3.4

Work sheet:
C D E F G
den ref cod gr price

The code will be in C2.
In D2 i will select ch09 from dropdown, and a cell back, in C2 i need the
code to retrieve mask. If i select another "ref" in D, then the code to
retrieve corresponding data from database sheet
Can this be done?
Thanks!


Not with VLOOKUP: that requires the information to fetch to be in the
same column, or to the right of the information to match. But there is a
way.

The following formula should work in "Work sheet" C2:
=INDEX(database!$C$2:$G$99,MATCH(work!$D2,database !$D$2:$D$99,0),MATCH(work!C$1,database!$C$1:$G$1,0 ))

One you have pasted it there, you can copy C2 and paste anywhere in
columns C,E,F and G to get relevant information for those columns as well.

If "database" is longer than 99 rows change "$99" in the formula
accordingly.


All times are GMT +1. The time now is 05:53 AM.

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