sum the values based on three columns

Arafat

Board Regular
Joined
May 3, 2011
Messages
61
Hi All,

I have a worksheet which has 4 columns.
The first column contains name of person,
The second column contains project code(the same code repeats for other persons as well),
The third column has target values(This also repeats),
The fourth column has total hours spent on that day.

I want a macro/array formula to calculate total target.
I have this formula =SUM((IF(A:A="julie",C:C*D:D))/SUM(IF(A:A="julie",D:D))) to calculate the total target, but i can use this formula only after pivotin the worksheet then segregating the data for every person which consumes too much time :( Kindly help me.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
If

Code:
[FONT=Lucida Console][SIZE=2]=SUM((IF(A:A="julie",C:C*D:D))/SUM(IF(A:A="julie",D:D)))[/SIZE][/FONT]

is correct, the following would be a tad faster:

Just enter...
Rich (BB code):
=SUMPRODUCT(($A$2:$A$1000=K2)+0,$C$2:$C$1000,$D$2:$D$1000)/
   SUMIF($A$2:$A$1000,K2,$D$2:$D$1000)
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,295
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top