#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Match


I have worksheet "OT Report" that looks like this:

EMPLOYEE # SUPERVISOR F NAME L NAME SCH WORKED
41531441 Open Deb Albr 36.00
9725217 Patty Glor Bat 40.00

120615975 Patty Lin Bea 40.00
105815219 Open Eliza Bris 24.00
12276142 Open Br Bro 40.00
37284952 Pat Lake Bro 15.00
143421680 Kathy Sar Bro 40.00

I have another worsheet "Download" that looks like this:

41531441 Albr, Deb R. FIXED CLASS: DA002
HRS: 51.5 WORKED 51.5 NON-WORKED 23.25 PAID
BY PAY CODE PRODUCTIVE 51.5 WEEKEND DAY
9725217 Bat, Glor G. FIXED CLASS: DA002
HRS: 73.75 WORKED 56.75 NON-WORKED 21 PAID
BY PAY CODE PRODUCTIVE 56.75 WEEKEND DAY
120615975 Bea, Lin M. FIXED CLASS: DA002
HRS: 57.5 WORKED 41.5 NON-WORKED 16 PAID

I need a code that looks for a match for employee# from OT Report on
the DownLoad and once it finds the match then finds the word Productive
from the a range associated with the cell location of the match, then
get the value of the cell next to the word productive and put it in the
cell under worked .


--
Teerings3
------------------------------------------------------------------------
Teerings3's Profile: http://www.excelforum.com/member.php...o&userid=29560
View this thread: http://www.excelforum.com/showthread...hreadid=492617

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Match

Hi,

No need to write VBA for that ....

you could use Worksheet formulae on the worksheet like this:

=INDIRECT(ADDRESS(MATCH(A:A,Sheet2!A:A,0)+1,4,4,1, "Sheet2"))

(goes in column F on your sheet OT Report!)

first we search for a match in column 1 (Employee no) on the sheet 2 column
1 and that returns 1 for the first one (meaning row 1)

then with the result of that, we use ADDRESS

And we pass the ADDRESS into the INDIRECT function to return the value we
want.

the three formulae, in colums G, H, I would be like this:

=MATCH(A:A,Sheet2!A:A,0)

returns 1 (for 1st row)

=ADDRESS(G:G+1,4,4,1,"Sheet2")

(notice I add one to G2, to offset the row by 1)

this returns an address Sheet2!D2

then in column I use INDIRECT:

=INDIRECT(H:H)

for Deb Albr it returns 51.5

BTW, this INDIRECT function need the source sheet containing the hours to be
open, or you could copy it to a temp sheet then refresh the formula, or you
would have to use the custom 'MoreFunc.xll' external ADD-IN by Laurent Longre
(see http://xcell05.free.fr/english/ )

HTH

Philip

"Teerings3" wrote:


I have worksheet "OT Report" that looks like this:

EMPLOYEE # SUPERVISOR F NAME L NAME SCH WORKED
41531441 Open Deb Albr 36.00
9725217 Patty Glor Bat 40.00

120615975 Patty Lin Bea 40.00
105815219 Open Eliza Bris 24.00
12276142 Open Br Bro 40.00
37284952 Pat Lake Bro 15.00
143421680 Kathy Sar Bro 40.00

I have another worsheet "Download" that looks like this:

41531441 Albr, Deb R. FIXED CLASS: DA002
HRS: 51.5 WORKED 51.5 NON-WORKED 23.25 PAID
BY PAY CODE PRODUCTIVE 51.5 WEEKEND DAY
9725217 Bat, Glor G. FIXED CLASS: DA002
HRS: 73.75 WORKED 56.75 NON-WORKED 21 PAID
BY PAY CODE PRODUCTIVE 56.75 WEEKEND DAY
120615975 Bea, Lin M. FIXED CLASS: DA002
HRS: 57.5 WORKED 41.5 NON-WORKED 16 PAID

I need a code that looks for a match for employee# from OT Report on
the DownLoad and once it finds the match then finds the word Productive
from the a range associated with the cell location of the match, then
get the value of the cell next to the word productive and put it in the
cell under worked .


--
Teerings3
------------------------------------------------------------------------
Teerings3's Profile: http://www.excelforum.com/member.php...o&userid=29560
View this thread: http://www.excelforum.com/showthread...hreadid=492617


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Match


Thanks that worked for my model, but the location of the wor
"productive" will vary
with each new download of employee time punches. Plus what ever I us
to get the hours of "pruductive" , I will then use to find PTO for tha
employee or OVERTIME and EIB, and so on..............The only constan
is that after you match employee# that key word will be found befor
the next employee # or the result is "0"

--
Teerings
-----------------------------------------------------------------------
Teerings3's Profile: http://www.excelforum.com/member.php...fo&userid=2956
View this thread: http://www.excelforum.com/showthread.php?threadid=49261

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
Match 2 Columns, Return 3rd, Differing Match Types Matt.Russett Excel Worksheet Functions 3 May 11th 10 10:45 AM
Lookup Formula: Return 1st match, then 2nd match, then 3rd match Scott Excel Discussion (Misc queries) 4 December 11th 09 05:50 AM
index(match) Wind Uplift Calculations (match four conditions) JMeier Excel Worksheet Functions 8 August 1st 08 01:45 AM
MATCH Multiple Criteria & Return Previous / Penultimate Match Sam via OfficeKB.com Excel Worksheet Functions 27 October 6th 07 01:39 AM
Lookup? Match? pulling rows from one spreadsheet to match a text f cjax Excel Worksheet Functions 3 July 21st 06 02:51 PM


All times are GMT +1. The time now is 05:11 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"