Using array if dates match

deduwa

Board Regular
Joined
Jul 28, 2015
Messages
110
Hi,

I think this can be done using an array formula but I just don't know how.

I have the below table;

MonthOld weightNew Weight
Jan-1930%?
Jan-1910%?
Feb-1930%?
Feb-1940%?
Feb-1925%?
Mar-1930%?
Mar-1915%?
Apr-1911%?
Apr-1922%?


In the 'New Weight' column, can I use an array formula which will re-balance the 'Old weight' to get the total of each month to total 100%?

For example for Jan, if 30% is the old weight then the new weight is 30%/(30%+10%) = 75%. Likewise for Jan, if 10% is the old weight, then the new weight is 10%/(30%+10%) = 25%

Following the same logic in Feb, if 30%, 40%, 25% are the old weights the new weights would be 32%, 42%, 26% respectively.

Hope this makes sense. The same concept will apply for all other months. (Note that the number of rows corresponding to each month is always different)

Thanks in advance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You just need a regular formula:

Book1
ABC
1MonthOld weightNew Weight
219-Jan30%75%
319-Jan10%25%
419-Feb30%32%
519-Feb40%42%
619-Feb25%26%
719-Mar30%67%
819-Mar15%33%
919-Apr11%33%
1019-Apr22%67%
Sheet4
Cell Formulas
RangeFormula
C2:C10C2=B2/(SUMIF(A:A,A2,B:B))
 
Upvote 0
Try this

varios 13jul2020.xlsm
ABC
1MonthOld weightNew Weight
219/01/202030%75%
319/01/202010%25%
419/02/202030%32%
519/02/202040%42%
619/02/202025%26%
719/03/202030%67%
819/03/202015%33%
919/04/202011%33%
1019/04/202022%67%
Hoja20
Cell Formulas
RangeFormula
C2:C10C2=B2/SUMIF($A$2:$A$10,A2,$B$2:$B$10)
 
Upvote 0
That's great, thank you both. You proved it was actually easier than I thought.

The next part is I want to then use the new weights to get a return for each month (See below)

MonthOld weightNew WeightReturn
Jan-1930%75%1%
Jan-1910%25%0.5%
Feb-1930%32%3%
Feb-1940%42%2%
Feb-1925%26%4.2%
Mar-1930%67%1%
Mar-1915%33%1%
Apr-1911%33%3.5%
Apr-1922%67%4%

I need to use SUMPRODUCT on the 'New Weight' & 'Return' columns such that I get the Return for each month;

Return
Jan-19?
Feb-19?
Mar-19?
Apr-19?

Can this be done using one formula and dragging down?

Thanks again.
 
Upvote 0
Is this what you need?

varios 13jul2020.xlsm
ABCDEFG
1MonthOld weightNew WeightReturnMonthReturn
201/01/201930%75%1.0%01/01/20190.008750
301/01/201910%25%0.5%01/02/20190.028947
401/02/201930%32%3.0%01/03/20190.010000
501/02/201940%42%2.0%01/04/20190.038333
601/02/201925%26%4.2%
701/03/201930%67%1.0%
801/03/201915%33%1.0%
901/04/201911%33%3.5%
1001/04/201922%67%4.0%
Hoja20
Cell Formulas
RangeFormula
G2:G5G2=SUMPRODUCT(($A$2:$A$10=F2)*($C$2:$C$10)*($D$2:$D$10))
C2:C10C2=B2/SUMIF($A$2:$A$10,A2,$B$2:$B$10)
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,717
Members
449,050
Latest member
MiguekHeka

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