Search and paste data from one workbook to another / 2 criteria

alex_i

New Member
Joined
Jul 14, 2016
Messages
5
Hi everyone,

I've been pulling my hairs in the last 3 weeks trying to find a solution to my Excel (2013) problem online - unfortunately without any success, so I've finally decided to post it and see if anyone would be willing to help. :confused:
Anyway, here is the deal:

I have two spreadsheets:
1. Sheet1 is a report that has 3 columns:
A – Employee N
B – Date (the report is weekly so there is a maximum of 7 different values)
C – Hours worked
Example:

Employee NDateHours worked
8001507/07/20167.75
8001508/07/20167
8001605/07/20168
8001606/07/20168
8001608/07/20168
8001703/07/20168.75
8001705/07/20168
8001706/07/20168.75
8001708/07/20168.75
8001803/07/20168
8001804/07/20168
8001805/07/20168
8001806/07/20168
8001808/07/20168

<tbody>
</tbody>



2. Sheet2 has a little bit more info and it looks like that:
FORNAMESSURNAMECLOCK 3-Jul4-Jul5-Jul6-Jul7-Jul8-Jul9-JulTOTAL
NUMBERSUNMONTUEWEDTHUFRISATHOURS
800157.75 70.00
800168 880.00
800178.75 88.758.750.00
800188 88880.00

<tbody>
</tbody>











At the moment I am reading the report (sheet1) and manually typing in the hours each worker did in sheet2 on a weekly basis.

If cell FORNAMES is A1, can I make cell E3 to search the whole report (sheet1) and display the value it finds based on two criteria (date and employee/clock N must both match)? Obviously I will extend the formula amongst all cells in the range E3:K6
If there is no such record in the report (sheet1) just leave the relevant cell in sheet2 empty.

Any suggestions?
If more details are required I will be monitoring the thread closely and try to reply asap.

Thanks for your help!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
is your 3-Jul, 4-Jul ...they are text values or Dates, can you populate them as same format as Col B, 03/07/2016, 04/07/2016 and so on...
 
Upvote 0
1> In Sheet1, Insert a column at C, then put C2= A2&"-"&B2 drag down
2> In Sheet2 , assuming you have Clock Number in Col C and 3-Jul in Col D, so put D3=Vlookup($C3&"-"&D$1,Sheet1!C:D,2,0) and drag to right and Down.
 
Upvote 0
Thank you so much! Will be checking if it is working properly on Monday and update the thread. Cheers
 
Upvote 0
Thank you so much! Will be checking if it is working properly on Monday and update the thread. Cheers

Now it is all working. Thanks again! What I had to figure out apart from adjusting the cell coordinates to my actual workbook was to figure out why it is working for the first day (3 - Jul) only. Then I found out that before I drag the formula in sheet2 sideways I had to add $s before C and D as follows:
=VLOOKUP($D8&"-"&F$6,Sheet1!$C:$D,2,0)

Also if anyone is using that solution - expect to meet #N/A in the cells where no data is available, which will have an impact on formulas having that particular cell in their range. In my case it was SUM(range). I had to change it to =SUMIF(RANGE, "<>#N/A") which worked as a charm.

Thanks a lot for the help!
 
Upvote 0

Forum statistics

Threads
1,215,518
Messages
6,125,292
Members
449,218
Latest member
Excel Master

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