Distribute Number into Several Part (Increment) Based on Other Data (Dynamic Array)

staticfluids

New Member
Joined
Apr 24, 2024
Messages
8
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
Hi all, I hope you're doing well.
First of all, sorry for bad explanation as my main language is not English.
I'm currently using Excel 2021 and trying to experiment with Dynamic Array formula. It's quite helping with my daily Excel use. 2 of my latest question was asking about Dynamic Array since I'm very new into this.

I wanted to ask. Refer to this post, I may have the same logic as the OP.
I wanted to distribute value from F:F to fill the value from B:B. I got the logic but turning it into formula is a bit tricky for me that's novice to this area. And I'm not sure if this is increment or not because I'm using a translator app. I think this is only a number distribution.

Anyway, the logic is:
SUMIF the same date on D:D for F:F cell -->
LOOK into the oldest date on D:D for F:F cell -->
take value at 1 cell at F -->
LOOK into the oldest date on A:A for B:B cell -->
SUBTRACT the value at 1 cell at F to the 1 cell at B -->
IF the current F cell has 0 value but the current B cell still have value, continue to the next F cell and DISTRIBUTE the value at F to B until the B value is 0 -->
IF the B value is 0 but F cell still have value, continue to the next B cell and DISTRIBUTE the value at F to B until the F value is 0 --> and so on until the F value on the last cell is 0 or having remaining value.

IF the value at F has decimals or remaining value, leave it at the end of the cell (or in the example, leave it at the top cell).

I think, the formula should be fill only at J:J and K:K. Or maybe from H:H until K:K but having a different formula for each first cell.

Example expected array:
Book2
ABCDEFGHIJK
1Month PeriodValueDateTypeValueMonth PeriodValue from B:BDateValue from F:F
201 September 2022£ 100.0004 November 2022 Transfer £ 400.0001 September 2022£ 100.0004 November 2022£100.00
301 August 2022£ 100.0012 July 2022 Transfer £ 25.0001 August 2022£ 100.0004 November 2022£82.50
401 July 2022£ 100.0002 July 2022 Transfer £ 100.0012 July 2022£17.50
501 June 2022£ 100.0006 June 2022 Transfer £ 25.0001 July 2022£ 100.0012 July 2022£7.50
601 May 2022£ 100.0026 May 2022 Transfer £ 75.0002 July 2022£92.50
701 April 2022£ 100.0005 May 2022 Transfer £ 2.5001 June 2022£ 100.0002 July 2022£7.50
801 March 2022£ 100.0005 May 2022 Transfer £ 50.0006 June 2022£25.00
901 February 2022£ 200.0022 April 2022 Transfer £ 110.0026 May 2022£67.50
1001 April 2022 Transfer £ 100.0001 May 2022£ 100.0026 May 2022£7.50
1113 March 2022 Transfer £ 100.0005 May 2022£52.50
1228 February 2022 Transfer £ 100.0022 April 2022£40.00
1311 February 2022 Transfer £ 3.0001 April 2022£ 100.0022 April 2022£70.00
1411 February 2022 Transfer £ 6.0001 April 2022£30.00
1511 February 2022 Transfer £ 1.0001 March 2022£ 100.0001 April 2022£70.00
1626 January 2022 Transfer £ 20.0013 March 2022£30.00
1701 February 2022£ 200.0013 March 2022£70.00
1828 February 2022£100.00
1911 February 2022£10.00
2026 January 2022£20.00
Sheet2



Example if the one last cell on F is having more value than the last cell on B:
Book2
ABCDEFGHIJK
1Month PeriodValueDateTypeValueMonth PeriodValue from B:BDateValue from F:F
201 September 2022£ 100.0004 November 2022 Transfer £ 400.0001 September 2022£ 100.0004 November 2022£217.50
301 August 2022£ 100.0012 July 2022 Transfer £ 25.0001 August 2022£ 100.0004 November 2022£82.50
401 July 2022£ 100.0002 July 2022 Transfer £ 100.0012 July 2022£17.50
501 June 2022£ 100.0006 June 2022 Transfer £ 25.0001 July 2022£ 100.0012 July 2022£7.50
601 May 2022£ 100.0026 May 2022 Transfer £ 75.0002 July 2022£92.50
701 April 2022£ 100.0005 May 2022 Transfer £ 2.5001 June 2022£ 100.0002 July 2022£7.50
801 March 2022£ 100.0005 May 2022 Transfer £ 50.0006 June 2022£25.00
901 February 2022£ 200.0022 April 2022 Transfer £ 110.0026 May 2022£67.50
1001 April 2022 Transfer £ 100.0001 May 2022£ 100.0026 May 2022£7.50
1113 March 2022 Transfer £ 100.0005 May 2022£52.50
1228 February 2022 Transfer £ 100.0022 April 2022£40.00
1311 February 2022 Transfer £ 3.0001 April 2022£ 100.0022 April 2022£70.00
1411 February 2022 Transfer £ 6.0001 April 2022£30.00
1511 February 2022 Transfer £ 1.0001 March 2022£ 100.0001 April 2022£70.00
1626 January 2022 Transfer £ 20.0013 March 2022£30.00
1701 February 2022£ 200.0013 March 2022£70.00
1828 February 2022£100.00
1911 February 2022£10.00
2026 January 2022£20.00
Sheet3



I attach the full expected array below, please have a look:
Book2
ABCDEFGHIJK
1Month PeriodValueDateTypeValueMonth PeriodValue from B:BDateValue from F:F
201 April 2024£ 200.0018 April 2024 Transfer £ 51.7501 April 2024£ 200.0018 April 2024£51.75
301 March 2024£ 200.0017 April 2024 Transfer £ 465.7517 April 2024£148.25
401 February 2024£ 100.0021 February 2024 Transfer £ 465.0001 March 2024£ 200.0017 April 2024£200.00
501 January 2024£ 100.0012 February 2024 Transfer £ 400.0001 February 2024£ 100.0017 April 2024£100.00
601 December 2023£ 200.0024 January 2024 Transfer £ 200.0001 January 2024£ 100.0017 April 2024£17.50
701 November 2023£ 200.0026 September 2023 Transfer £ 200.0021 February 2024£82.50
801 October 2023£ 100.0028 May 2023 Transfer £ 300.0001 December 2023£ 200.0021 February 2024£200.00
901 September 2023£ 100.0031 March 2023 Transfer £ 100.0001 November 2023£ 200.0021 February 2024£182.50
1001 August 2023£ 200.0030 January 2023 Transfer £ 100.0012 February 2024£17.50
1101 July 2023£ 200.0010 December 2022 Transfer £ 100.0001 October 2023£ 100.0012 February 2024£100.00
1201 June 2023£ 200.0004 November 2022 Transfer £ 400.0001 September 2023£ 100.0012 February 2024£100.00
1301 May 2023£ 100.0012 July 2022 Transfer £ 25.0001 August 2023£ 200.0012 February 2024£182.50
1401 April 2023£ 100.0002 July 2022 Transfer £ 100.0024 January 2024£17.50
1501 March 2023£ 100.0006 June 2022 Transfer £ 25.0001 July 2023£ 200.0024 January 2024£182.50
1601 February 2023£ 100.0026 May 2022 Transfer £ 75.0026 September 2023£17.50
1701 January 2023£ 100.0005 May 2022 Transfer £ 2.5001 June 2023£ 200.0026 September 2023£182.50
1801 December 2022£ 100.0005 May 2022 Transfer £ 50.0028 May 2023£17.50
1901 November 2022£ 100.0022 April 2022 Transfer £ 110.0001 May 2023£ 100.0028 May 2023£100.00
2001 October 2022£ 100.0001 April 2022 Transfer £ 100.0001 April 2023£ 100.0028 May 2023£100.00
2101 September 2022£ 100.0013 March 2022 Transfer £ 100.0001 March 2023£ 100.0028 May 2023£82.50
2201 August 2022£ 100.0028 February 2022 Transfer £ 100.0031 March 2023£17.50
2301 July 2022£ 100.0011 February 2022 Transfer £ 3.0001 February 2023£ 100.0031 March 2023£82.50
2401 June 2022£ 100.0011 February 2022 Transfer £ 6.0030 January 2023£17.50
2501 May 2022£ 100.0011 February 2022 Transfer £ 1.0001 January 2023£ 100.0030 January 2023£82.50
2601 April 2022£ 100.0026 January 2022 Transfer £ 20.0010 December 2022£17.50
2701 March 2022£ 100.0001 December 2022£ 100.0010 December 2022£82.50
2801 February 2022£ 200.0004 November 2022£17.50
2901 October 2023£ 100.0001 November 2022£ 100.0004 November 2022£100.00
3001 September 2023£ 100.0001 October 2022£ 100.0004 November 2022£100.00
3101 August 2023£ 200.0001 September 2022£ 100.0004 November 2022£100.00
3201 July 2023£ 200.0001 August 2022£ 100.0004 November 2022£82.50
3301 June 2023£ 200.0012 July 2022£17.50
3401 May 2023£ 100.0001 July 2022£ 100.0012 July 2022£7.50
3501 April 2023£ 100.0002 July 2022£92.50
3601 March 2023£ 100.0001 June 2022£ 100.0002 July 2022£7.50
3701 February 2023£ 100.0006 June 2022£25.00
3801 January 2023£ 100.0026 May 2022£67.50
3901 December 2022£ 100.0001 May 2022£ 100.0026 May 2022£7.50
4001 November 2022£ 100.0005 May 2022£52.50
4101 October 2022£ 100.0022 April 2022£40.00
4201 September 2022£ 100.0001 April 2022£ 100.0022 April 2022£70.00
4301 August 2022£ 100.0001 April 2022£30.00
4401 July 2022£ 100.0001 March 2022£ 100.0001 April 2022£70.00
4501 June 2022£ 100.0013 March 2022£30.00
4601 May 2022£ 100.0001 February 2022£ 200.0013 March 2022£70.00
4701 April 2022£ 100.0028 February 2022£100.00
4801 March 2022£ 100.0011 February 2022£10.00
4901 February 2022£ 200.0026 January 2022£20.00
5001 October 2023£ 100.0012 February 2024£100.00
5101 September 2023£ 100.0012 February 2024£100.00
5201 August 2023£ 200.0012 February 2024£182.50
5324 January 2024£17.50
5401 July 2023£ 200.0024 January 2024£182.50
5526 September 2023£17.50
5601 June 2023£ 200.0026 September 2023£182.50
5728 May 2023£17.50
5801 May 2023£ 100.0028 May 2023£100.00
5901 April 2023£ 100.0028 May 2023£100.00
6001 March 2023£ 100.0028 May 2023£82.50
6131 March 2023£17.50
6201 February 2023£ 100.0031 March 2023£82.50
6330 January 2023£17.50
6401 January 2023£ 100.0030 January 2023£82.50
6510 December 2022£17.50
6601 December 2022£ 100.0010 December 2022£82.50
6704 November 2022£17.50
6801 November 2022£ 100.0004 November 2022£100.00
6901 October 2022£ 100.0004 November 2022£100.00
7001 September 2022£ 100.0004 November 2022£100.00
7101 August 2022£ 100.0004 November 2022£82.50
7212 July 2022£17.50
7301 July 2022£ 100.0012 July 2022£7.50
7402 July 2022£92.50
7501 June 2022£ 100.0002 July 2022£7.50
7606 June 2022£25.00
7726 May 2022£67.50
7801 May 2022£ 100.0026 May 2022£7.50
7905 May 2022£52.50
8022 April 2022£40.00
8101 April 2022£ 100.0022 April 2022£70.00
8201 April 2022£30.00
8301 March 2022£ 100.0001 April 2022£70.00
8413 March 2022£30.00
8501 February 2022£ 200.0013 March 2022£70.00
8628 February 2022£100.00
8711 February 2022£10.00
8826 January 2022£20.00
Sheet1


This is a dynamic data; the data is always updated. So I'm looking a way to find a dynamic array formula to avoid manual editing when the data is updated either on A:B or D:F.

Any help would be much appreciated.
Thank you!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I read this 3 times and couldn't figure out how you got the numbers. You might have to a smaller example.
 
Upvote 0
Sorry if i'm not good explaining into words. Perhaps this could help understanding the logic.

A:B is the budget per month (forecast)
D:F is the actual money transferred. Notice that the transferred is sometimes not the same as the budget month. Sometimes earlier and sometimes delayed. Sometimes big number sometimes small number. I want to distribute the actual into the forecast.

Book3
HIJKLMNO
1Month Period Value from B:B Date Value from F:F
201 September 2022£ 100.0004 November 2022£ 100.00<--Last cell
301 August 2022£ 100.0004 November 2022£ 82.50<--£ 100.00<----SUM of J3:J4
412 July 2022£ 17.50
501 July 2022£ 100.0012 July 2022£ 7.50<--£ 100.00
602 July 2022£ 92.50
701 June 2022£ 100.0002 July 2022£ 7.50<--£ 100.00
806 June 2022£ 25.00
926 May 2022£ 67.50
1001 May 2022£ 100.0026 May 2022£ 7.50<--£ 100.00
1105 May 2022£ 52.50
1222 April 2022£ 40.00
1301 April 2022£ 100.0022 April 2022£ 70.00<--£ 100.00
1401 April 2022£ 30.00
1501 March 2022£ 100.0001 April 2022£ 70.00<--£ 100.00
1613 March 2022£ 30.00
1701 February 2022£ 200.0013 March 2022£ 70.00<--£ 200.00<----SUM of J17:J20
1828 February 2022£ 100.00
1911 February 2022£ 10.00
2026 January 2022£ 20.00
Sheet1
Cell Formulas
RangeFormula
M3,M15,M13,M5M3=SUM(K3:K4)
M7,M10M7=SUM(K7:K9)
M17M17=SUM(K17:K20)
 
Upvote 0

Forum statistics

Threads
1,223,876
Messages
6,175,123
Members
452,614
Latest member
MRSWIN2709

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