Feeling dim: How to simplify this formula? SUMIF

stuartmacdonald

New Member
Joined
May 26, 2009
Messages
48
I have a formula I'm trying to simplify to calculate how work is spread among project staff.

I need to calculate a value (£) based on a value in the same row (%), so if H4 = 20%, return 20% of C4, in cell N4 - simple
=SUM($H4*C4,$H5*C5,$H6*C6,$H7*C7)

Jan FebMarTotalStaff 1Staff 2Staff 3Jan FebMar
Project 1£1,000£4,000£5,000£10,00020%20%60%100%Staff 1£10,100£7,200£7,300£24,600
Project 2£3,000£2,000£6,000£11,00050%50%0%100%Staff 2£1,700£1,800£4,000£7,500
Project 3£8,000£4,000£3,000£15,00090%0%10%100%Staff 3£4,200£7,000£4,700£15,900
Project 4£4,000£6,000£2,000£12,00030%0%70%100%£16,000£16,000£16,000£48,000
£16,000£16,000£16,000£48,000

<colgroup><col><col><col span="3"><col><col span="4"><col><col><col span="4"></colgroup><tbody>
</tbody>

Problem is I need to do this for a number of ranges across a number of sheets, and I cannot figure it out.
I assumed I should be using a SUMIF but I cannot get it to work... feeling a bit dim
I need a formula which looks at H4:H7 and calculates the values from C4:C7 and returns the value in N4:N7

I have attached an example here, and while this works, I cannot replicate this approach on the scale I need it.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try this: https://www.dropbox.com/s/h0bvn2in1he74zu/stuartmacdonald_Example.xlsx?dl=0

(If clicking on the link doesn't work.. copy and paste it into the browser addressbar..)

Excel 2010
MNOP
3JanFebMar
4Staff 1£10,100£7,200£7,300
5Staff 2£1,700£1,800£4,000
6Staff 3£4,200£7,000£4,700

<tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
N4=SUMPRODUCT(INDEX($C$4:$E$7,,MATCH(N$3,$C$3:$E$3,0)),INDEX($H$4:$J$7,,MATCH($M4,$H$3:$J$3,0)))

<tbody>
</tbody>

<tbody>
</tbody>


Does that work?
 
Last edited:
Upvote 0
Actually, the second index-match is overkill:


Excel 2010
BCDEFGHIJKLMNOPQ
3JanFebMarTotalStaff 1Staff 2Staff 3JanFebMar
4Project 1£1,000£4,000£5,000£10,00020%20%60%100%Staff 1£10,100£7,200£7,300£24,600
5Project 2£3,000£2,000£6,000£11,00050%50%0%100%Staff 2£1,700£1,800£4,000£7,500
6Project 3£8,000£4,000£3,000£15,00090%0%10%100%Staff 3£4,200£7,000£4,700£15,900
7Project 4£4,000£6,000£2,000£12,00030%0%70%100%£16,000£16,000£16,000£48,000
8£16,000£16,000£16,000£48,000

<tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
N4=SUMPRODUCT(INDEX($H$4:$J$7,,MATCH($M4,$H$3:$J$3,0)),C$4:C$7)

<tbody>
</tbody>

<tbody>
</tbody>

This will work as well
 
Upvote 0
Thank you very much, SUMPRODUCT works....
Now I need to add together the SUMPRODUCT from 5 sheets. I have tried a number things, but this is what makes most sense to me, but it's not working

=SUMPRODUCT(Sheet1!AK4:AK40,Sheet1!Q4:Q40)+(Sheet2!AK4:AK7,Sheet2!Q4:Q7)+(Sheet3!AJ4:AJ25,Sheet3!Q4:Q25)+('Sheet4'!AM4:AM15,'Sheet4'!Q4:Q15)+(Sheet5!AJ4:AJ12,Sheet5!Q4:Q12)

Any suggestions?
 
Upvote 0
Thank you very much, SUMPRODUCT works....
Now I need to add together the SUMPRODUCT from 5 sheets. I have tried a number things, but this is what makes most sense to me, but it's not working

=SUMPRODUCT(Sheet1!AK4:AK40,Sheet1!Q4:Q40)+(Sheet2!AK4:AK7,Sheet2!Q4:Q7)+(Sheet3!AJ4:AJ25,Sheet3!Q4:Q25)+('Sheet4'!AM4:AM15,'Sheet4'!Q4:Q15)+(Sheet5!AJ4:AJ12,Sheet5!Q4:Q12)

Any suggestions?

I'm not sure (wrt Forum Rules) whether this needs to be a new post or not.. (as it's a different topic).


You need to REPEAT the SUMPRODUCT for each sheet..

e.g. =SUMPRODUCT(Sheet1!AK4:AK40,Sheet1!Q4:Q40) + SUMPRODUCT(Sheet2!AK4:AK40,Sheet2!Q4:Q40) + SUMPRODUCT(Sheet3!AK4:AK40,Sheet3!Q4:Q40)



as in
add together the SUMPRODUCT

So [SUMPRODUCT of sheet1] + [SUMPRODUCT of sheet2] + [SUMPRODUCT of sheet3] and so on
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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