Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default List with wages

Hello

I have a list of people with related wage data.
In column "A" there is a unique number for each person.
In column "B" the name of the person.
In column "C" number of days.
Every person can be in one or more rows.
I want to sum the values in column "C" for each person, and write the data
(in a single row) into a new sheet.

Any helt would be appreciatad

Regards,
TC, Sweden


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default List with wages

Thorleif,

For each person's number, use a formula like

=SUMPRODUCT((Sheet1!A1:A20=1)*(Sheet1!C1:C20))

the 1 being the unique number. Repeat for each person.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Thorleif Cederqvist" wrote in
message ...
Hello

I have a list of people with related wage data.
In column "A" there is a unique number for each person.
In column "B" the name of the person.
In column "C" number of days.
Every person can be in one or more rows.
I want to sum the values in column "C" for each person, and write the data
(in a single row) into a new sheet.

Any helt would be appreciatad

Regards,
TC, Sweden




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default List with wages

TC

One way:

Select the new sheet
Select Data | Filter | Advanced Filter
Click on "copy to another location"
In the List range box, select the column (A) with the "staff number" data in
the "master" sheet
In the Copy to box, select cell A1 on the new sheet
Select Unique records only
Click OK

In cell B1 on the new sheet, enter the formula:
=VLOOKUP(Sheet2!A1,Sheet1!$A$1:$C$11,2,FALSE)
Adjust the cell ranges as necessary and then fill down

In cell C1 on the new sheet, enter the formula:
=VLOOKUP(Sheet2!A1,Sheet1!$A$1:$C$11,3,FALSE)
In cell C2 on the new sheet, enter the formula:
=SUMIF(Sheet1!$A$2:$A$11,A2,Sheet1!$C$2:$C$11)
Adjust the cell ranges as necessary and then fill down

You could record this to see the code generated but you would need to modify
it a little to cater for the varying number of rows of data.

This is some sample code based on 11 rows of information (including the
header row). Note this is not what you get if you simply record the
actions.

Sub Macro1()
With Sheets("Sheet2")
Sheets("Sheet1").Columns("A:A").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("A1"), Unique:=True
.Range("B1").FormulaR1C1 =
"=VLOOKUP(Sheet2!RC[-1],Sheet1!R1C1:R11C3,2,FALSE)"
.Range("B1").AutoFill Destination:=.Range("B1:B5"), Type:=xlFillDefault
.Range("C1").FormulaR1C1 =
"=VLOOKUP(Sheet2!RC[-2],Sheet1!R1C1:R11C3,3,FALSE)"
.Range("C2").FormulaR1C1 =
"=SUMIF(Sheet1!R2C1:R11C1,RC[-2],Sheet1!R2C3:R11C3)"
.Range("C2").AutoFill Destination:=.Range("C2:C5"), Type:=xlFillDefault
End With
End Sub


Regards

Trevor


"Thorleif Cederqvist" wrote in
message ...
Hello

I have a list of people with related wage data.
In column "A" there is a unique number for each person.
In column "B" the name of the person.
In column "C" number of days.
Every person can be in one or more rows.
I want to sum the values in column "C" for each person, and write the data
(in a single row) into a new sheet.

Any helt would be appreciatad

Regards,
TC, Sweden




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default List with wages

Thanks Bob and Trevor

I solved it by code, but thanks!

TC, Sweden
"Thorleif Cederqvist" skrev i
meddelandet ...
Hello

I have a list of people with related wage data.
In column "A" there is a unique number for each person.
In column "B" the name of the person.
In column "C" number of days.
Every person can be in one or more rows.
I want to sum the values in column "C" for each person, and write the data
(in a single row) into a new sheet.

Any helt would be appreciatad

Regards,
TC, Sweden




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
Notes and Coinage for Wages Owl Excel Worksheet Functions 3 August 2nd 08 12:53 AM
Fun With That Wages Book Again Gatsby Setting up and Configuration of Excel 20 January 15th 07 09:17 AM
calculating wages rooney2oons Excel Discussion (Misc queries) 3 August 19th 06 01:08 PM
Amount of Increase of Wages dah Excel Worksheet Functions 8 September 27th 05 10:31 PM
Calculate Wages John Excel Worksheet Functions 2 December 17th 04 03:42 PM


All times are GMT +1. The time now is 09:07 PM.

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

About Us

"It's about Microsoft Excel"