0
votes

I have three sheets, sheet1, sheet2, and sheet3.

Sheet 1 have column like : Project, employee name, hours worked, date Sheet 2 have Column like : employee name, rate/hour

So the common between two sheets are employee name.

Sheet 1 will be updating every day, so that sheet will not have define range.

$ spent will be calculated on = Sheet1! hours worked * Sheet2 rate/hour (Here common in both sheet is employee name)

Total $ spent on each project, that i achieved, but i need to know how to calculate $ spent on last 30 days.

3
What is Sheet 3 for? Is this where you want to the sums? - gtr1971
yes, i need output in that sheet - user3248817
Are you calculating the $ for each employee on sheet3 then add then up or directly the total? - Jerry
No, i am calculation each project $ then i will calculate total Project $ in sheet 3, here i will get employee name in sheet1 and sheet2, from sheet1 i will get project name, employee name and hours, from sheet2 i will get employee name, rate/hour, so no project name in sheet2. - user3248817
So you will have the "Project Names" pre populated in Sheet 3? Could the list of employees be across the columns to build a matrix that could be populated? - Ken

3 Answers

0
votes

You can use IF to remove older values from your sum. Something like:

=IF(NOW()-Sheet1!Date <= 30, Sheet1!HoursWorked*Sheet2!Rate,0)
0
votes

Create a new column in Sheet 1 titled "Cost". Put following formula in E2 and copy down.

=IF(D2-TODAY()>30,0,C2*INDEX(SHEET2RATECOLUMN,MATCH(b2,SHEET2NAMECOLUMN,0)))

Create a new pivot table on Sheet 3 using sheet 1 as the input. Put the employees on the rows, and sum "Cost" in the data section of the table.

Assumes Sheet 1 Column D is date, Column B is employee, and Column C is hours.

0
votes

Sheet 1

Project   Employee   Hours   Date
AA        Ken        2.0     14-Feb
BB        Ken        1.0     01-Jan
AA        Rob        1.5     15-Feb
BB        Ken        7.0     01-Mar

Sheet 2

Employee    Rate
Ken         50.00
Rob         20.00

Sheet 3

Project    Ken    Rob    Total
AA         <B2>
BB
Total

in B2 enter the following formula =SUMIFS(Sheet1!$C:$C,Sheet1!$B:$B,B$1,Sheet1!$A:$A,$A2,Sheet1!$D:$D,">"&TODAY()-30)*INDEX(Sheet2!$B:$B,MATCH(B$1,Sheet2!$A:$A,0))

Copy formula to all projects rows, and employee columns. Put Sum equation into "total" columns and rows.