Index with two match formulas

Upetr

New Member
Joined
Aug 15, 2011
Messages
3
I have a timesheet with dates on the one page. Each user has a timesheet and I want to do a lookup to another sheet which contains the duration spent at work.

E F G
2011-08-01 2011-08-02 2011-08-01

Now I have the look up sheet (Sheet1) which contains everyone's names, dates for the month and duration.

A B C
Andrew 2011-08-01 7h40
Andrew 2011-08-02 7h45
Andrew 2011-08-03 8h30
John 2011-08-01 8h15
John 2011-08-02 7h30

Now I need to get the durations for John for the different days in the columns below the dates. In this case into E2,F2,G2.
I use the Match formula to get the row number =MATCH("John",Sheet1!A:A,) and I get the first occurence which is 4. Then I use the same formula to get the date but =MATCH(E1,Sheet1!D:D,) but I get row 1 because I don't know how to combine the two formulas into one. I have used index to try and get the results of the column number - but wasn's lucky in combining them. How can I do this - or is there a better way? Thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I have a timesheet with dates on the one page. Each user has a timesheet and I want to do a lookup to another sheet which contains the duration spent at work.

E F G
2011-08-01 2011-08-02 2011-08-01

Now I have the look up sheet (Sheet1) which contains everyone's names, dates for the month and duration.

A B C
Andrew 2011-08-01 7h40
Andrew 2011-08-02 7h45
Andrew 2011-08-03 8h30
John 2011-08-01 8h15
John 2011-08-02 7h30

Now I need to get the durations for John for the different days in the columns below the dates. In this case into E2,F2,G2.
I use the Match formula to get the row number =MATCH("John",Sheet1!A:A,) and I get the first occurence which is 4. Then I use the same formula to get the date but =MATCH(E1,Sheet1!D:D,) but I get row 1 because I don't know how to combine the two formulas into one. I have used index to try and get the results of the column number - but wasn's lucky in combining them. How can I do this - or is there a better way? Thanks.
What version of Excel are you using?
 
Upvote 0
I am using 2007.
Try something like this...

Your raw data table:

Book1
ABC
1NameDateTime
2Andrew8/1/20117h40
3Andrew8/2/20117h45
4Andrew8/3/20118h30
5John8/1/20118h15
6John8/2/20117h30
Sheet1

Your summary table:

Book1
DEFG
1_8/1/20118/2/20118/3/2011
2Andrew7h407h458h30
3John8h157h30_
Sheet2

This array formula** entered in E2:

=IFERROR(INDEX(Sheet1!$C$2:$C$6,MATCH(1,IF(Sheet1!$A$2:$A$6=$D2,IF(Sheet1!$B$2:$B$6=E$1,1)),0)),"")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Copy across to G2 then down as needed.
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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