#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brendy
 
Posts: n/a
Default EXCEL LOOKUP

Hi I have an excel workbook with 2 sheets, the first sheet has all the
information in it and the second is where I want the results displayed.
In sheet 1 have a row of dates (52 weeks of the year) in cells B1:BA1,
In column A starting at A2:A173 I have a list of names and in cells
B2:BA173 I have a list of duty numbers. In sheet 2 I have a formatted
form and on that form I want to create a formula that let's me enter a
date and a duty and return the name of the person doing that duty.

EG A B C D
1 2/1/06 9/1/06 16/1/06
2 JOHN 1 2 3
3 BILLY 2 3 1
4 TOM 3 1 2


If in sheet 2 I ENTERED 2/1/06 and duty 2, the result should be
BILLY

I have been wrecking my brains for weeks trying to solve this but
Can't, it would be much appreciated if someone could help me THANK YOU.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default EXCEL LOOKUP

Date in K1, duty in L1.

=INDEX('Sheet1'!$A$2:$A$173, MATCH($L$1, OFFSET('Sheet1'!$A$2:$A$173,
0, MATCH($K$1, 'Sheet1'!$B$2:$BA$2,0)),0)

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brendy
 
Posts: n/a
Default EXCEL LOOKUP

Thanks for your reply vezerid but the result I get is #N/A

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default EXCEL LOOKUP

Apologies... I should have tested the formula first. This one should
work:
=INDEX(Sheet1!$A$2:$A$171,MATCH($L$1,OFFSET(Sheet1 !$A$2:$A$171,0,MATCH($K$1,Sheet1!$B$1:$BA$1,0)),0) )

HTH
Kostis Vezerides

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brendy
 
Posts: n/a
Default EXCEL LOOKUP

Thanks vezerid your a star, the formula works, now I have the task of
understanding how you did it , thanks again



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default EXCEL LOOKUP

Just one minor change...

=INDEX('Sheet1'!$A$2:$A$173, MATCH($L$1, OFFSET('Sheet1'!$A$2:$A$173,0,
MATCH($K$1, 'Sheet1'!$B$1:$BA$1,0)),0)


"Brendy" wrote:

Thanks for your reply vezerid but the result I get is #N/A


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default EXCEL LOOKUP

INDEX(array, pos) gives you the element in the array found in position
pos.
MATCH(value, array) is the reverse, it tells you in which position
value is.
OFFSET(range, row, col,..., ...) returns a reference to a range which
is offset.
Basically the formula does the following:
The inner MATCH() finds the position of the date in your date headers.
It then computes the offset of the original column by as many columns
as the position of the date.
We then try to find the position of the duty in the offset column.
This position is used in INDEX of the original array with the names to
return the corresponding name.

Glad to be of help.

Kostis Vezerides

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Brendy
 
Posts: n/a
Default EXCEL LOOKUP

vezerid could you modify this so I can copy the formula down the column
without getting #N/A if the cell were the date and duty go is blank. I
have tried to add the function IF and ISNA to your formula but with no
success.

Thanks again

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default EXCEL LOOKUP

If I understand you correctly, this is an altogether different problem.

Now, for a single date and a blank duty, what exactly do you want to
retrieve?
All the persons scheduled for that day? This is very different and
requires a completely different logic.
Please be more specific. Also, soon I will have to go, so maybe someone
else can answer if I am gone after you answer.

Regards,
Kostis

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Difference in number of Excel NewsGroups Hari Prasadh Excel Discussion (Misc queries) 1 January 25th 05 11:32 AM
how to use lookup a value by date for criteria in Excel sheet dom Excel Worksheet Functions 5 January 11th 05 04:22 AM
Lookup Access data in Excel Chris Kellock Excel Worksheet Functions 1 December 28th 04 01:51 PM
HELP! Excel Lookup formula tommie Excel Worksheet Functions 1 November 29th 04 11:45 AM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"