Multiple function difficult formula (array, sumif, if, etc)

SolCo

New Member
Joined
Jul 11, 2011
Messages
42
I'm looking for a formula (or two), that will allow me to do the following:

For any given project code (column A), if the sum of the ON Shore weights is equal to zero (Column C), then apportion those costs (Column D) which are associated to all the On shore rows (for that given project code) equally across all the Off Shore rows (for that given project code).

And Vice versa

i.e. for any given project code (column A), if the sum of the OFF Shore weights is equal to zero Column C), then apportion those costs (Column D) which are associated to all the OFF shore rows (for that given project code) equally across all the ON Shore rows (for that given project code).

And if both the sum of the On Shore and OFF Shore is not equal to 0, then leave the costs column (D) as it currently is.


I'm having serious trouble with this, if anyone could help me with this, it would be greatly appreciated.
Thanks!!!
PROJECT_IDSHOREWEIGHT Costs Weighted Costs
aOn Shore0.1 123
aOn Shore0.1 234
aOn Shore0.8 345
bOn Shore0 543
bOn Shore0.67 432
bOn Shore0.33 527
bOn Shore0 571
cOn Shore1 614
dOn Shore1 658
eOff Shore0.5 701
eOff Shore0 745
eOff Shore0.5 788
eOff Shore0 832
fOff Shore1 875
gOff Shore0 919
gOff Shore1 962
hOff Shore1 1,006
iOn Shore0.39 1,049
iOn Shore0.61 765
jOff Shore1 64
kOff Shore0 53
kOff Shore1 576
lOn Shore1 68

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi,

If you are using Excel 2007 or later, the following should work for you. Please copy the formulas from columns G, H, I, J down as far as necessary. Column G gives the amount resulting from repartitioning. Note that it reports more cases of repartitioning than what you have indicated, so please check it very carefully if my solution is OK.

J.Ty.

Excel Workbook
ABCDEFGHIJ
1PROJECT_IDSHOREWEIGHTCostsWeighted CostsTo be addedhelp1help2help3
2aOn Shore0.112301230.82
3aOn Shore0.112301230.82
4aOff Shore0.812302460.21
5bOn Shore054305430.333
6bOn Shore0.6754305430.333
7bOff Shore0.33543016290.671
8bOn Shore054305430.333
9cOn Shore16140001
10dOn Shore16580001
11eOff Shore0.5701233.666770103
12eOn Shore07010210311
13eOff Shore0.5701233.666770103
14eOff Shore0701233.666770103
15fOff Shore18750001
16gOn Shore0919091911
17gOff Shore191991991901
18hOff Shore11,0060001
19iOn Shore0.391,0490002
20iOn Shore0.611,0490002
21jOff Shore1640001
22kOff Shore05305311
23kOn Shore153535301
24lOn Shore1680001
Sheet1
 
Upvote 0
Thanks for this solution, I'm not sure I understand it just yet...

Does this solution result in the 701 from D12, being equally apportioned between D11, D13 and D14?
Also, does this solution take care of the vice versa scenario? ie. when the ON's and OFF's are reversed


Thanks so much for your help!!
 
Upvote 0
Does this solution result in the 701 from D12, being equally apportioned between D11, D13 and D14?

Yes, this amount 701 divided into 3 (i.e., 233.6667) is reported as "To be added" is rows 11, 13 and 14.

Also, does this solution take care of the vice versa scenario? ie. when the ON's and OFF's are reversed

Yes, this happens in rows 22 and 23 (project k), where Off Shore cost is reported as "To be added" to On Shore cost.


Best,

J.Ty.
 
Upvote 0
oooh I think you've got it!!

I'm gonna run it through my sheet- but fantastic stuff !! Great work and always really appreciated!

Best regards - if I need to, I hope its ok to come back to you further on this if I can;'t make it work.

Soli
 
Upvote 0
Dear Soli,

Thanks for the feedback and good luck!
Don't forget to exchange ";" into "," in all my formulas, as my signature reminds.
Of course, you can always send me a private message or reply to this thread - I'll keep my subscription to it.

Best,

J.Ty.
 
Upvote 0
Dear Soli,

Thanks for the feedback and good luck!
Don't forget to exchange ";" into "," in all my formulas, as my signature reminds.
Of course, you can always send me a private message or reply to this thread - I'll keep my subscription to it.

Best,

J.Ty.

Hi J.Ty.

Wanted to know what your formula is looking to do (if anything) when any given project only has ON shore or only has OFF shore, but not both. I think it's programmed to do nothing at the moment. But please could you confirm that.

If it is programmed to do nothing, then I believe I'll need some further help with this..
 
Upvote 0
Indeed, it does nothing when there is only one kind of costs.
Strictly speaking:

1) In a line with ON shore it looks for all OFF shore costs from the same project and verifies if there is anything that should be added to it
2) In a line with OFF shore it looks for all ON shore costs from the same project and verifies if there is anything that should be added to it

J.Ty.
 
Upvote 0
Indeed, it does nothing when there is only one kind of costs.
Strictly speaking:

1) In a line with ON shore it looks for all OFF shore costs from the same project and verifies if there is anything that should be added to it
2) In a line with OFF shore it looks for all ON shore costs from the same project and verifies if there is anything that should be added to it

J.Ty.

Ok thanks, as I thought ( I wasn't sure of what the "&" was in the formula.

Please would you be able to help me with the following additional criteria..

For any given project code, where there is both On and an Off shore presence, then multiply the On shore total cost by 0.66 and multiply the Off shore total cost by 0.33. If there is only OFF shore or only On shore then, the total is multiplied by 1 - i.e. no action.

Hopefully that's not too complicated, but I'm not sure how to build that formula either.

Thanks J.Ty. really appreciate it
 
Upvote 0
I have computed the factors: 0.33, 0.66 or 1, as you defined them. I am not absolutely sure how to use them. Please have a look at it.

J.Ty.

Excel Workbook
ABCDEFGHIJK
1PROJECT_IDSHOREWEIGHTCostsWeighted Costsmultiply factorTo be addedhelp1help2help3help4
2aOn Shore0.11230.6601230.821
3aOn Shore0.11230.6601230.821
4aOff Shore0.81230.3302460.212
Sheet1
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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