View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Auto filling data according to seperate worksheet

One way which should deliver it ..

Assuming data in both Sheet1 and Sheet2 start in row 2 down

We'll use Emp# to match since this is the unique key

In Sheet1,

Put in C2's formula bar, then array-enter** by pressing CTRL+SHIFT+ENTER
(instead of just pressing ENTER):

=IF(ISNA(MATCH(1,(Sheet2!$B$2:$B$100=$B2)*(Sheet2! $C$2:$C$100=C$1),0)),"",INDEX(Sheet2!$D$2:$D$100,M ATCH(1,(Sheet2!$B$2:$B$100=$B2)*(Sheet2!$C$2:$C$10 0=C$1),0)))

Copy C2 across as many cols as there are dates in row1, then just fill down
as far as required to populate the grid.

**Correctly done, Excel will insert curly braces: { } around the formula.
Confirm this is so by viewing the formula bar. If you don't see the curly
braces, then it hasn't been correctly array-entered.

Adjust the ranges to suit the actual extents before you copy C2 across/down:
Sheet2!$B$2:$B$100
Sheet2!$D$2:$D$100
Sheet2!$C$2:$C$100
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"mpenkala" wrote:
Okay - so I've got a toughie of a question and hope someone can help me out.
Here's the low down...

Worksheet1 is a simple spreadsheet which lists Employee Names in Column 'A',
Employee # in Column 'B' and each day of the month from column 'C' on... The
spreadsheet has 6 months of this on each worksheet.

Worksheet2 is a simple spreadsheet with Employee Names in Column 'A',
Employee # in Column 'B', Date worked in Column 'C' and Hours worked in
Column 'D'.

Now Worksheet2 is a report that I get from another department. What I need
to do is take the hours worked from worksheet2 and enter them into
worksheet1. I currently do this manually, but am hoping there is a way
(maybe macros) to have excel do it automatically.

What I need is for worksheet1 to see which employee worked on what day (from
worksheet2) and fill in the data on worksheet1 in the appropriate areas.

Any ideas or comments would be greatly appriciated.

Thanks,
Matt