Dynamic way of calculating billing values between two months

Akhalkalak

New Member
Joined
May 5, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a data set that contains clients' names, client ID, product ID, annual amount billed, client industry, and product purchase date (also the start date of billing). I'm trying to find a way to input any customer name and any two months (February - November, April-May, etc) and retrieve the total amount billed to said client in this time frame.

Customers vary by industry and each industry has a different billing frequency. I've used IFS to calculate the next billing period for every customer based on their industry and that industry's billing frequency. The purchases & billing all begins in 2014/15, and I am trying to find the amount billed between any two months in 2017 (all purchases are renewed every billing period).

I am a bit confused on how to approach the rest of this project from here on out and would really appreciate some feedback. Since there is a set amount billed annually, wouldn't it make sense that it doesn't really matter what specific day billing began for a customer? If a customer is billed quarterly, and say it began on 3/13/2014, how would I get to the 2017 values that would allow me to input any two months and customer name and get the correct $$$ billed?
 
If we take the customer Bioplex for the months Feb & July.
They have 2 records each for Feb. & July which add up to $101,724. Is this the answer you want or would it be something else?
If this is not the correct answer, then what should it be (actual dollar amount) and how did you get it?
Book1
ABCDEF
1Customer NameProduct IDCustomer ID IndustryAmount Billed Annual Product Purchase Date
2Bioplexniri120iaRUH5273Higher Education$ 49,434.0012/24/2015
3Bioplexyjuu121etRUH5273Higher Education$ 4,515.007/9/2014
4Bioplexfrh1113zmRUH5273Higher Education$ 39,854.0010/13/2014
5Bioplexxydvl 16tuRUH5273Higher Education$ 74,789.0011/10/2015
6Bioplexa btb98wmRUH5273Higher Education$ 81,724.0010/8/2015
7Bioplexxcgz111seRUH5273Higher Education$ 4,121.007/28/2015
8Bioplexorug114ewRUH5273Higher Education$ 73,574.002/25/2014
9Bioplexmwavl17znRUH5273Higher Education$ 19,514.002/7/2014
10
11
12$ 101,724.00Sum of Feb & July
Sheet2
Cell Formulas
RangeFormula
E12E12=E3+E7+E8+E9
But the problem is that just adds up the annual amount that is listed. Bioplex is in the "Higher Education" industry, and therefore it is billed quarterly, so I need to take that into consideration in my total billed amount formula. Also, since the purchases began on 2014 and 2015, and I am asked to find the total amount billed between any two months of 2017, I'm assuming I have to creating a billing cycle into 2017, which I am confused on how to do.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
The only think I can suggest is that with customer Bioplex you figure out what the annual amount is and divide by 4 to get the quarterly amount. Then assuming no price increase and products stay the same. For Feb. it would just be the quarterly price. For July it would be 3 times the quarterly price to get amount billed.
 
Upvote 0
The only think I can suggest is that with customer Bioplex you figure out what the annual amount is and divide by 4 to get the quarterly amount. Then assuming no price increase and products stay the same. For Feb. it would just be the quarterly price. For July it would be 3 times the quarterly price to get amount billed.
So I have the amount to be billed per frequency per customer, but how would I incorporate this into one big formula that pulls that number based on the date range and customer?
 
Upvote 0
How about showing us what you have and then an actual example. So, pick a customer and a date range and show us what amount you expect and why. Then me may be able to help you with a formula.
 
Upvote 0
How about showing us what you have and then an actual example. So, pick a customer and a date range and show us what amount you expect and why. Then me may be able to help you with a formula.
1683407855128.png

Here is an example where I try to find the total amount to be billed to Bioplex between February - July, 2017
I do not want it to just sum up the annual amounts in column E, I need it to take into consideration the billing frequency, for example, in this Bioplex case, I want it to take the total amount billed between February and July, but factor in the fact that the annual amount shown is billed quarterly, so every 3 months, per product based on each products respective purchase date
1683408099305.png


1683407919295.png
I added these columns that calculate the next billing frequency per customer based on their industry, but not sure if there is a more efficient way to do it, I tried to make a data table but was unable to.
 

Attachments

  • 1683407829124.png
    1683407829124.png
    14.7 KB · Views: 6
Upvote 0
So would the answer be $76,293.00.
Number in cell I4 in the example below will change as industry changes.
If this works I'll leave up to you to figure cell I7 based on the industry.
Book1
ABCDEFGHIJ
1Customer NameProduct IDCustomer ID IndustryAmount Billed Annual Product Purchase DateCustomerStart MonthEnd Month
2Betasoloinfdw115rtOLX3928Commercial Property Mgmt 316696/8/2015Bioplex27
3Betasoloinqbdt1041gOLX3928Commercial Property Mgmt 87565/15/2014Higher EducationQuarterly
4Betasoloinauuh99kdOLX3928Commercial Property Mgmt432677/11/2014Amount Quarterly4
5Betasoloinhtoi103feOLX3928Commercial Property Mgmt711943/19/2014$ 25,431.00
6Betatechpmad110jyENC2036Higher Education611123/24/2014Number of Qtrs
7Betatechnhon112trENC2036Higher Education456945/7/20143$ 76,293.00
8Betatechahws101jqENC2036Higher Education524494/20/2014
9Betatechbod117zaENC2036Higher Education72941/25/2014
10Bioholdingbqkm112wmPSF4581Corporate371162/19/2015IndusryBilling FrequencyFrequency
11Bioholdingchot112rePSF4581Corporate6220911/25/2014Commercial Property Mgmt Monthly12
12Bioholdingcwla115sbPSF4581Corporate374296/7/2015Higher EducationQuarterly4
13Bioholdingcljx118aiPSF4581Corporate655039/28/2015CorporateAnnally1
14Bioplexniri120iaRUH5273Higher Education4943412/24/2015RetailMonthly12
15Bioplexyjuu121etRUH5273Higher Education45157/9/2014WirelessMonthly12
16Bioplexfrh1113zmRUH5273Higher Education3985410/13/2014HealthcareQuarterly4
17Bioplexxydvl 16tuRUH5273Higher Education7478911/10/2015
18Bioplexa btb98wmRUH5273Higher Education8172410/8/2015
19Bioplexxcgz111seRUH5273Higher Education41217/28/2015
20Bioplexorug114ewRUH5273Higher Education735742/25/2014
21Bioplexmwavl17znRUH5273Higher Education195142/7/2014
22Blackzimquwa109rnwMZV8706Retail520074/26/2015
23Blackzimcoqd112fmMZV8706Retail783652/24/2014
24Blackzimwuzql 17keMZV8706Retail972844/2/2015
25Blackzimtdds108zhMZV8706Retail777785/23/2015
26Blackzimhgdm108kvMZV8706Retail212702/2/2014
27Blackzimastc99xyMZV8706Retail607537/16/2014
28Cancityhsab119cqWR15364Higher Education941239/25/2014
29Cancityvde1116reWR15364Higher Education8989411/12/2015
30Cancityjwqz98zkWR15364Higher Education2347312/10/2015
31Cancityyxwb109nqWR15364Higher Education6457312/26/2014
Sheet4
Cell Formulas
RangeFormula
I3I3=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$I$11:$I$16)
I4I4=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$J$11:$J$16)
H3H3=XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31)
H4H4="Amount "&$I$3
H5H5=SUM(FILTER($E$2:$E$31,($A$2:$A$31=$H$2)*(MONTH($F$2:$F$31)>=$I$2)*(MONTH($F$2:$F$31)<=$J$2)))/I4
H7H7=(IFS($J$2<=3,1,$J$2<=6,2,$J$2<=9,3,$J$2<=12,4)-IFS($I$2<=3,1,$I$2<=6,2,$I$2<=9,3,$I$2<=12,4))+1
I7I7=H5*H7
 
Upvote 0
So would the answer be $76,293.00.
Number in cell I4 in the example below will change as industry changes.
If this works I'll leave up to you to figure cell I7 based on the industry.
Book1
ABCDEFGHIJ
1Customer NameProduct IDCustomer ID IndustryAmount Billed Annual Product Purchase DateCustomerStart MonthEnd Month
2Betasoloinfdw115rtOLX3928Commercial Property Mgmt 316696/8/2015Bioplex27
3Betasoloinqbdt1041gOLX3928Commercial Property Mgmt 87565/15/2014Higher EducationQuarterly
4Betasoloinauuh99kdOLX3928Commercial Property Mgmt432677/11/2014Amount Quarterly4
5Betasoloinhtoi103feOLX3928Commercial Property Mgmt711943/19/2014$ 25,431.00
6Betatechpmad110jyENC2036Higher Education611123/24/2014Number of Qtrs
7Betatechnhon112trENC2036Higher Education456945/7/20143$ 76,293.00
8Betatechahws101jqENC2036Higher Education524494/20/2014
9Betatechbod117zaENC2036Higher Education72941/25/2014
10Bioholdingbqkm112wmPSF4581Corporate371162/19/2015IndusryBilling FrequencyFrequency
11Bioholdingchot112rePSF4581Corporate6220911/25/2014Commercial Property Mgmt Monthly12
12Bioholdingcwla115sbPSF4581Corporate374296/7/2015Higher EducationQuarterly4
13Bioholdingcljx118aiPSF4581Corporate655039/28/2015CorporateAnnally1
14Bioplexniri120iaRUH5273Higher Education4943412/24/2015RetailMonthly12
15Bioplexyjuu121etRUH5273Higher Education45157/9/2014WirelessMonthly12
16Bioplexfrh1113zmRUH5273Higher Education3985410/13/2014HealthcareQuarterly4
17Bioplexxydvl 16tuRUH5273Higher Education7478911/10/2015
18Bioplexa btb98wmRUH5273Higher Education8172410/8/2015
19Bioplexxcgz111seRUH5273Higher Education41217/28/2015
20Bioplexorug114ewRUH5273Higher Education735742/25/2014
21Bioplexmwavl17znRUH5273Higher Education195142/7/2014
22Blackzimquwa109rnwMZV8706Retail520074/26/2015
23Blackzimcoqd112fmMZV8706Retail783652/24/2014
24Blackzimwuzql 17keMZV8706Retail972844/2/2015
25Blackzimtdds108zhMZV8706Retail777785/23/2015
26Blackzimhgdm108kvMZV8706Retail212702/2/2014
27Blackzimastc99xyMZV8706Retail607537/16/2014
28Cancityhsab119cqWR15364Higher Education941239/25/2014
29Cancityvde1116reWR15364Higher Education8989411/12/2015
30Cancityjwqz98zkWR15364Higher Education2347312/10/2015
31Cancityyxwb109nqWR15364Higher Education6457312/26/2014
Sheet4
Cell Formulas
RangeFormula
I3I3=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$I$11:$I$16)
I4I4=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$J$11:$J$16)
H3H3=XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31)
H4H4="Amount "&$I$3
H5H5=SUM(FILTER($E$2:$E$31,($A$2:$A$31=$H$2)*(MONTH($F$2:$F$31)>=$I$2)*(MONTH($F$2:$F$31)<=$J$2)))/I4
H7H7=(IFS($J$2<=3,1,$J$2<=6,2,$J$2<=9,3,$J$2<=12,4)-IFS($I$2<=3,1,$I$2<=6,2,$I$2<=9,3,$I$2<=12,4))+1
I7I7=H5*H7
I will take a look and get back to you, thank you so much for your help so far!
 
Upvote 0
I will take a look and get back to you, thank you so much for your help so far!
So would the answer be $76,293.00.
Number in cell I4 in the example below will change as industry changes.
If this works I'll leave up to you to figure cell I7 based on the industry.
Book1
ABCDEFGHIJ
1Customer NameProduct IDCustomer ID IndustryAmount Billed Annual Product Purchase DateCustomerStart MonthEnd Month
2Betasoloinfdw115rtOLX3928Commercial Property Mgmt 316696/8/2015Bioplex27
3Betasoloinqbdt1041gOLX3928Commercial Property Mgmt 87565/15/2014Higher EducationQuarterly
4Betasoloinauuh99kdOLX3928Commercial Property Mgmt432677/11/2014Amount Quarterly4
5Betasoloinhtoi103feOLX3928Commercial Property Mgmt711943/19/2014$ 25,431.00
6Betatechpmad110jyENC2036Higher Education611123/24/2014Number of Qtrs
7Betatechnhon112trENC2036Higher Education456945/7/20143$ 76,293.00
8Betatechahws101jqENC2036Higher Education524494/20/2014
9Betatechbod117zaENC2036Higher Education72941/25/2014
10Bioholdingbqkm112wmPSF4581Corporate371162/19/2015IndusryBilling FrequencyFrequency
11Bioholdingchot112rePSF4581Corporate6220911/25/2014Commercial Property Mgmt Monthly12
12Bioholdingcwla115sbPSF4581Corporate374296/7/2015Higher EducationQuarterly4
13Bioholdingcljx118aiPSF4581Corporate655039/28/2015CorporateAnnally1
14Bioplexniri120iaRUH5273Higher Education4943412/24/2015RetailMonthly12
15Bioplexyjuu121etRUH5273Higher Education45157/9/2014WirelessMonthly12
16Bioplexfrh1113zmRUH5273Higher Education3985410/13/2014HealthcareQuarterly4
17Bioplexxydvl 16tuRUH5273Higher Education7478911/10/2015
18Bioplexa btb98wmRUH5273Higher Education8172410/8/2015
19Bioplexxcgz111seRUH5273Higher Education41217/28/2015
20Bioplexorug114ewRUH5273Higher Education735742/25/2014
21Bioplexmwavl17znRUH5273Higher Education195142/7/2014
22Blackzimquwa109rnwMZV8706Retail520074/26/2015
23Blackzimcoqd112fmMZV8706Retail783652/24/2014
24Blackzimwuzql 17keMZV8706Retail972844/2/2015
25Blackzimtdds108zhMZV8706Retail777785/23/2015
26Blackzimhgdm108kvMZV8706Retail212702/2/2014
27Blackzimastc99xyMZV8706Retail607537/16/2014
28Cancityhsab119cqWR15364Higher Education941239/25/2014
29Cancityvde1116reWR15364Higher Education8989411/12/2015
30Cancityjwqz98zkWR15364Higher Education2347312/10/2015
31Cancityyxwb109nqWR15364Higher Education6457312/26/2014
Sheet4
Cell Formulas
RangeFormula
I3I3=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$I$11:$I$16)
I4I4=XLOOKUP(XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31),$H$11:$H$16,$J$11:$J$16)
H3H3=XLOOKUP($H$2,$A$2:$A$31,$D$2:$D$31)
H4H4="Amount "&$I$3
H5H5=SUM(FILTER($E$2:$E$31,($A$2:$A$31=$H$2)*(MONTH($F$2:$F$31)>=$I$2)*(MONTH($F$2:$F$31)<=$J$2)))/I4
H7H7=(IFS($J$2<=3,1,$J$2<=6,2,$J$2<=9,3,$J$2<=12,4)-IFS($I$2<=3,1,$I$2<=6,2,$I$2<=9,3,$I$2<=12,4))+1
I7I7=H5*H7
So this is good, however, I noticed an issue, let's say I put the months as 1-12 for January - December, I am getting an incorrect value and I also noticed the same when doing just a few months. I think this has to do with the last formula that is linked with the number of quarters.
 
Upvote 0
You need to show an example or 2 of what's wrong and what the answer should be.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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