Lookup Question

Can_This_Be_Don

Board Regular
Joined
Feb 15, 2005
Messages
88
Not sure how to set up this vlookup so am seeking advice. In cell G1 a code will be entered. I then need to look in the table (cells A1:C8) if it is found, to look at the day and carry the corresponding time to column H against the appropriate day.

To give you a better understanding G1 shows LSA03, in the table it finds the matching record, to the left it then finds the day, then the value in C4 is shown in H4.

The data I'm showung is only an example but I'm struggling to get the vlookup to work correctly.
Book1
ABCDEFGH
1DayDutyStartDutyLSA03
2MonLSA0109:00Mon
3TueLSA0210:45Tue
4WedLSA0312:30Wed12:30
5ThuLSA0414:15Thu
6FriLSA0516:00Fri
7SatLSA0817:45Sat
8SunLSA919:30Sun
Sheet1
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
=IF(G2=OFFSET($A$1,MATCH($G$1,$B$2:$B$8,0),0),OFFSET($A$1,MATCH($G$1,$B$2:$B$8,0),2),"")

I added the ,"" at the end so you can have blanks if there's no match
 
Upvote 0
Because mine is more complicated and fancier :)

When you get into the complexity mode...
*blush*
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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