Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default lookup and display

A C D G
H I J
Emp# Code Hours salary regular ot vacation
93 REGSAL 4.00 4.00 0.00 0.00 0.00
93 OVTIME 4.03 4.00 0.00 0.00 0.00
93 REGLAR 7.98 4.00 0.00 0.00 0.00
93 VACTON 8.00 4.00 0.00 0.00 0.00

I'm trying to display the hours worked (column D) in their respective
columns (G,H,I,J) but the only column that will display is column G. Here are
the formulas I'm using.

Salary: IF(VLOOKUP(A2,A:C,3,0)="REGSAL",VLOOKUP(A2,A:D,4,0 ),0)
Regular: IF(VLOOKUP(A2,A:C,3,0)="REGLAR",VLOOKUP(A2,A:D,4,0 ),0)
OT: IF(VLOOKUP(A2,A:C,3,0)="OVTIME",VLOOKUP(A2,A:D,4,0 ),0)
Vacation:IF(VLOOKUP(A2,A:C,3,0)="VACTON",VLOOKUP(A 2,A:D,4,0),0)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default lookup and display

GAIDEN wrote:
A C D G
H I J
Emp# Code Hours salary regular ot vacation
93 REGSAL 4.00 4.00 0.00 0.00 0.00
93 OVTIME 4.03 4.00 0.00 0.00 0.00
93 REGLAR 7.98 4.00 0.00 0.00 0.00
93 VACTON 8.00 4.00 0.00 0.00 0.00

I'm trying to display the hours worked (column D) in their respective
columns (G,H,I,J) but the only column that will display is column G. Here are
the formulas I'm using.

Salary: IF(VLOOKUP(A2,A:C,3,0)="REGSAL",VLOOKUP(A2,A:D,4,0 ),0)
Regular: IF(VLOOKUP(A2,A:C,3,0)="REGLAR",VLOOKUP(A2,A:D,4,0 ),0)
OT: IF(VLOOKUP(A2,A:C,3,0)="OVTIME",VLOOKUP(A2,A:D,4,0 ),0)
Vacation:IF(VLOOKUP(A2,A:C,3,0)="VACTON",VLOOKUP(A 2,A:D,4,0),0)



The problem is you are looking up the value in column A (emp#), not
column C (Code).

Forget the VLOOKUPs. I suggest the following:

Emp# Code Hours REGSAL OVTIME REGLAR VACTON
93 REGSAL 4 4 0 0 0
93 OVTIME 4.03 0 4.03 0 0
93 REGLAR 7.98 0 0 7.98 0
93 VACTON 8 0 0 0 8

The formula in $G$2 that can be pasted, and filled right and down
through $J$5 is
=SUMIF($C2,G$1,$D2)


Or you could do this if you like your column headers the way they a

Emp# Code Hours salary regular ot vacation
93 REGSAL 4 4 0 0 0
93 OVTIME 4.03 0 4.03 0 0
93 REGLAR 7.98 0 0 7.98 0
93 VACTON 8 0 0 0 8

where the formulae in columns G:J are like
=IF($C2="REGSAL",$D2,0)
=IF($C2="OVTIME",$D2,0)
=IF($C2="REGLAR",$D2,0)
=IF($C2="VACTON",$D2,0)
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default lookup and display

i was just advised to use
=SUMPRODUCT(--(A2:A10=A2),--(C2:C10="code"),D2:D10)
and it worked. thanks though

"smartin" wrote:

GAIDEN wrote:
A C D G
H I J
Emp# Code Hours salary regular ot vacation
93 REGSAL 4.00 4.00 0.00 0.00 0.00
93 OVTIME 4.03 4.00 0.00 0.00 0.00
93 REGLAR 7.98 4.00 0.00 0.00 0.00
93 VACTON 8.00 4.00 0.00 0.00 0.00

I'm trying to display the hours worked (column D) in their respective
columns (G,H,I,J) but the only column that will display is column G. Here are
the formulas I'm using.

Salary: IF(VLOOKUP(A2,A:C,3,0)="REGSAL",VLOOKUP(A2,A:D,4,0 ),0)
Regular: IF(VLOOKUP(A2,A:C,3,0)="REGLAR",VLOOKUP(A2,A:D,4,0 ),0)
OT: IF(VLOOKUP(A2,A:C,3,0)="OVTIME",VLOOKUP(A2,A:D,4,0 ),0)
Vacation:IF(VLOOKUP(A2,A:C,3,0)="VACTON",VLOOKUP(A 2,A:D,4,0),0)



The problem is you are looking up the value in column A (emp#), not
column C (Code).

Forget the VLOOKUPs. I suggest the following:

Emp# Code Hours REGSAL OVTIME REGLAR VACTON
93 REGSAL 4 4 0 0 0
93 OVTIME 4.03 0 4.03 0 0
93 REGLAR 7.98 0 0 7.98 0
93 VACTON 8 0 0 0 8

The formula in $G$2 that can be pasted, and filled right and down
through $J$5 is
=SUMIF($C2,G$1,$D2)


Or you could do this if you like your column headers the way they a

Emp# Code Hours salary regular ot vacation
93 REGSAL 4 4 0 0 0
93 OVTIME 4.03 0 4.03 0 0
93 REGLAR 7.98 0 0 7.98 0
93 VACTON 8 0 0 0 8

where the formulae in columns G:J are like
=IF($C2="REGSAL",$D2,0)
=IF($C2="OVTIME",$D2,0)
=IF($C2="REGLAR",$D2,0)
=IF($C2="VACTON",$D2,0)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default lookup and display

List these text as the headers instead in G1:J1 :
REGSAL, REGLAR, OVTIME, VACTON

Then you could place this in G2: =IF($C2=G$1,$D2,0)
Copy G2 across to J2, fill down as far as required
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:16,400 Files:356 Subscribers:53
xdemechanik
---
"GAIDEN" wrote:
A C D G
H I J
Emp# Code Hours salary regular ot vacation
93 REGSAL 4.00 4.00 0.00 0.00 0.00
93 OVTIME 4.03 4.00 0.00 0.00 0.00
93 REGLAR 7.98 4.00 0.00 0.00 0.00
93 VACTON 8.00 4.00 0.00 0.00 0.00

I'm trying to display the hours worked (column D) in their respective
columns (G,H,I,J) but the only column that will display is column G. Here are
the formulas I'm using.

Salary: IF(VLOOKUP(A2,A:C,3,0)="REGSAL",VLOOKUP(A2,A:D,4,0 ),0)
Regular: IF(VLOOKUP(A2,A:C,3,0)="REGLAR",VLOOKUP(A2,A:D,4,0 ),0)
OT: IF(VLOOKUP(A2,A:C,3,0)="OVTIME",VLOOKUP(A2,A:D,4,0 ),0)
Vacation:IF(VLOOKUP(A2,A:C,3,0)="VACTON",VLOOKUP(A 2,A:D,4,0),0)


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default lookup and display

i was just advised to use
=SUMPRODUCT(--(A2:A10=A2),--(C2:C10="code"),D2:D10)
and it worked. thanks though.

"Max" wrote:

List these text as the headers instead in G1:J1 :
REGSAL, REGLAR, OVTIME, VACTON

Then you could place this in G2: =IF($C2=G$1,$D2,0)
Copy G2 across to J2, fill down as far as required
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:16,400 Files:356 Subscribers:53
xdemechanik
---
"GAIDEN" wrote:
A C D G
H I J
Emp# Code Hours salary regular ot vacation
93 REGSAL 4.00 4.00 0.00 0.00 0.00
93 OVTIME 4.03 4.00 0.00 0.00 0.00
93 REGLAR 7.98 4.00 0.00 0.00 0.00
93 VACTON 8.00 4.00 0.00 0.00 0.00

I'm trying to display the hours worked (column D) in their respective
columns (G,H,I,J) but the only column that will display is column G. Here are
the formulas I'm using.

Salary: IF(VLOOKUP(A2,A:C,3,0)="REGSAL",VLOOKUP(A2,A:D,4,0 ),0)
Regular: IF(VLOOKUP(A2,A:C,3,0)="REGLAR",VLOOKUP(A2,A:D,4,0 ),0)
OT: IF(VLOOKUP(A2,A:C,3,0)="OVTIME",VLOOKUP(A2,A:D,4,0 ),0)
Vacation:IF(VLOOKUP(A2,A:C,3,0)="VACTON",VLOOKUP(A 2,A:D,4,0),0)




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default lookup and display

No prob. Believe that wasn't your intents as expressed in your original post
here, though.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads: 16,300, Files: 356, Subscribers: 53
xdemechanik
---
"GAIDEN" wrote in message
...
i was just advised to use
=SUMPRODUCT(--(A2:A10=A2),--(C2:C10="code"),D2:D10)
and it worked. thanks though.



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
LookUp to Display Last Value Populated a in Range sony654 Excel Worksheet Functions 13 May 11th 08 05:46 AM
Lookup from range to display a row Shamit Excel Discussion (Misc queries) 0 November 20th 07 05:01 PM
Lookup and Display Using Multiple Criteria GB Excel Worksheet Functions 4 October 3rd 06 11:40 PM
excel lookup matching and value display garyww Links and Linking in Excel 1 August 25th 06 02:55 AM
excel lookup matching and value display garyww Excel Worksheet Functions 1 August 21st 06 04:37 AM


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