Dynamic range adding help

themev

Board Regular
Joined
Aug 13, 2007
Messages
83
We are forecasting a fee to charge every year at some point after making a sale. Lets just say that the charge will be $10 per unit sold and be charged forever. We aren't sure what year it will kick in though so it could be 1 year after the sale, 2 years, 3 years etc. Some more details are below.
Here is the how the sheet looks
Cell B1 = $10 (the charge per unit)
B2-F2 have the years 2022-2026
B3-F3 have the units sold that year
B4-F4 have the cumulative units
B5 indicates which year the service charge should kick in = lets say 2 years, which would mean that in 2024, the units sold in 2022 will all be charged the $10 fee. In 2025, the units sold in both 2022 and 2023 would be charged $10 per unit. In 2026, the units sold in 2022-2024 would be charged $10.
I would want to build a formula to put into B6-F6 to calculate the fee, but to be able to change if B5 changes to 1 year or 3 years etc.
Service charge$ 10
Year20222023202420252026
Units Sold58121620
Cumulative units513254161
Service charge year2
Service charge fee

Excel Formula:

I am at a loss of how to even go about building this. Is this possible? Sorry, my work PC will not allow me to install XL2BB...
Thanks in advance for any guidance!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

See if this does what you want.

21 10 18.xlsm
ABCDEF
1Service charge$10
2Year20222023202420252026
3Units Sold58121620
4Cumulative units513254161
5Service charge year2
6Service charge fee  50130250
Fee
Cell Formulas
RangeFormula
B6:F6B6=IF(COLUMNS($B:B)>$B5,INDEX($B4:$F4,COLUMNS($B:B)-$B5)*$B1,"")


Reason for mentioning Excel version info is that if you are using Microsoft 365, the formula can be constructed to run more efficiently (& written a little shorter) as follows
Excel Formula:
=LET(c,COLUMNS($B:B),IF(c>$B5,INDEX($B4:$F4,c-$B5)*$B1,""))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,628
Members
449,240
Latest member
lynnfromHGT

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