Reference function

monkey_wrench

New Member
Joined
Jan 20, 2004
Messages
2
Below are two spreadsheets. Spreadsheet 1 contains a date field and Manufacture A, B and C as headers. Under each manufacture are the hours worked and the corresponding dates of the hours that were worked.

Spreadsheet 2 is a table that I would like to reference spreadsheet 1 using “lookup functions”. Referencing the Manufacture and total hours is an easy reference to make. The problem is automating the lookup for the Start date and Finish date. What I would like it to do for the START DATE is to look for the first hours worked and return the corresponding date, I.E. Manufacture A would be 1/12/04, Manufacture B would be 1/13/04, etc. I would also like to do the same thing for the DATE FINISHED I.E Finish date for Manufacture A would be 1/17/04, man B would be 1/16/04 and Man C would be 1/15/04. how can I do this???????

-----------------------------------------------
Spreadsheet 1
------------------------------------------------

_Date _| A | B | C |

1/12/04 | 4 | 0 | 0 |
1/13/04 | 4 | 2 | 0 |
1/14/04 | 2 | 6 | 1 |
1/15/04 | 0 | 6 | 5 |
1/16/04 | 0 | 5 | 0 |
1/17/14 | 4 | 0 | 0 |


-------------------------------------------
spreadsheet 2
--------------------------------------------

Manuf | start date| finish date| Total hours|

____ ____________________________________
Manu A | 1/12/04 | 1/17/14 | 14
_________________________________________
Manu B | 1/13/04 | 1/16/04 | 19
_________________________________________
Manu C | 1/14/04 | 1/15/04 | 6
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
Let A1:D8 on Sheet1 house the sample you provided, including labels.

Sheet2
Book1
ABCDE
1MANUSTARTFINISHHOURS
21A1/12/20041/17/200414
32B1/13/20041/16/200419
43C1/14/20041/15/20046
Sheet2


Formulas...

A2:

=MATCH($B2,Sheet1!$B$1:$D$1,0)

C2:

=INDEX(Sheet1!$A$2:$A$8,MIN(IF(INDEX(Sheet1!$B$2:$D$8,0,$A2)>0,ROW(INDEX(Sheet1!$B$2:$D$8,0,$A2))))-(CELL("Row",Sheet1!B$2)-1))

which must be confirmed with control+shift+enter instead of just with enter.

D2:

=INDEX(Sheet1!$A$2:$A$8,MAX(IF(INDEX(Sheet1!$B$2:$D$8,0,$A2)>0,ROW(INDEX(Sheet1!$B$2:$D$8,0,$A2))))-(CELL("Row",Sheet1!C$2)-1))

Again confirm with control+shift+enter.

E2:

=SUM(INDEX(Sheet1!$B$2:$D$8,0,$A2))
 

monkey_wrench

New Member
Joined
Jan 20, 2004
Messages
2
Just wanted to thank you guys for the help...I will try both the formulas and see which one works better for me...thanks again
-Gerrit
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,101
Messages
5,768,101
Members
425,453
Latest member
bince

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
Top