Search and paste value from other sheet (combination of vlookup,hlookup,index)

Forestq

Active Member
Joined
May 9, 2010
Messages
482
Hi,

ino sheet1 I have table:
table_1.png


Into sheet2 I have other table:

tabl2.png


How to write a function, that will be automaticly taken value from sheet1 and put into col H - Target, to sheet2?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Here's what I have in Sheet 1:


Book1
ABCPQRS
1Sales Level 1Sales Level 2COL3Q1Q2Q3Q4
2EMEAR-REGIONEMEAR-CENTRALA1163146
3EMEAR-REGIONEMEAR-CENTRALD2173247
4EMEAR-REGIONEMEAR-CENTRALB3183348
5EMEAR-REGIONEMEAR-CENTRALC4193449
6EMEAR-REGIONEMEAR-CENTRALE5203550
7EMEAR-REGIONEMEAR_GERMANYA6213651
8EMEAR-REGIONEMEAR_GERMANYD7223752
9EMEAR-REGIONEMEAR_GERMANYB8233853
10EMEAR-REGIONEMEAR_GERMANYC9243954
11EMEAR-REGIONEMEAR_GERMANYE10254055
12EMEAR-REGIONEMEAR_POLA11264156
13EMEAR-REGIONEMEAR_POLD12274257
14EMEAR-REGIONEMEAR_POLB13284358
15EMEAR-REGIONEMEAR_POLC14294459
16EMEAR-REGIONEMEAR_POLE15304560
Sheet1


And here's my Sheet 2:


Book1
ABCDEFGH
1YearTimeQuarterTheatreSales Level 1Sales Level 2SegmentTarget
220162016Q1Q1CENTRALEMEAR-REGIONEMEAR-CENTRALA1
320162016Q2Q2CENTRALEMEAR-REGIONEMEAR-CENTRALA16
420162016Q3Q3CENTRALEMEAR-REGIONEMEAR-CENTRALA31
520162016Q4Q4CENTRALEMEAR-REGIONEMEAR-CENTRALA46
620162016Q1Q1CENTRALEMEAR-REGIONEMEAR-CENTRALB3
720162016Q2Q2CENTRALEMEAR-REGIONEMEAR-CENTRALB18
820162016Q3Q3CENTRALEMEAR-REGIONEMEAR-CENTRALB33
920162016Q4Q4CENTRALEMEAR-REGIONEMEAR-CENTRALB48
1020162016Q1Q1CENTRALEMEAR-REGIONEMEAR-CENTRALC4
1120162016Q2Q2CENTRALEMEAR-REGIONEMEAR-CENTRALC19
1220162016Q3Q3CENTRALEMEAR-REGIONEMEAR-CENTRALC34
1320162016Q4Q4CENTRALEMEAR-REGIONEMEAR-CENTRALC49
1420162016Q1Q1CENTRALEMEAR-REGIONEMEAR-CENTRALD2
1520162016Q2Q2CENTRALEMEAR-REGIONEMEAR-CENTRALD17
1620162016Q3Q3CENTRALEMEAR-REGIONEMEAR-CENTRALD32
1720162016Q4Q4CENTRALEMEAR-REGIONEMEAR-CENTRALD47
1820162016Q1Q1CENTRALEMEAR-REGIONEMEAR-CENTRALE5
1920162016Q2Q2CENTRALEMEAR-REGIONEMEAR-CENTRALE20
2020162016Q3Q3CENTRALEMEAR-REGIONEMEAR-CENTRALE35
2120162016Q4Q4CENTRALEMEAR-REGIONEMEAR-CENTRALE50
Sheet2
Cell Formulas
RangeFormula
H2{=INDEX(Sheet1!$P:$S,MATCH(1,(Sheet1!A:A=$E2)*(Sheet1!B:B=$F2)*(Sheet1!C:C=$G2),0),MATCH($C2,Sheet1!$P$1:$S$1,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Hope that's somewhere near what you're after.

WBD
 
Upvote 0
Hi... If anyone needs the solution...

One way is to:
Make index columns as Sheet1:B+C and Sheet2:F+G, to use as the key fields
Use a formula in sheet2:H with if loops on sheet2:C value to check as “Q1”, “Q2”, “Q3” or “Q4”; to “VLOOKUP” on the above index Sheet1:P,Q,R,S value respectively
:)
 
Upvote 0
thank you wideboydixon! just checked and it's working fine.

Good to know. Note that the performance won't be fantastic as it's processing all the rows in the sheet. If you know how many rows you have in Sheet1, you could optimize a little bit.

WBD
 
Upvote 0
working slowly, but working, number of rows is always the same. so I will change it, but one time per quater it can working like this ;)
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top