1

I am trying to create an IF Statement that based off the start date, life of the contract and Prepaid amount it will populate accordingly in the correct month.

Example: start date is 7/1/2017, amount is $911.97 and life of contract is 3 months. How do I get each month to reflect the correct monthly cost for that month if any, based on the life of the contract?

If just for 3 months Oct and on should have zeroes.

Example:

screenshot

THANKS FOR YOUR HELP!

7
  • Is number of months always an integer or can it be fractions like say 3.5 months? Is End Date calculated based on Start Date & Number of months? What is in Cell O8 as referred in your formula and how is it relevant? It seems it's a hidden column.
    – patkim
    Feb 15, 2018 at 21:54
  • The # of months will always be an integer. End date formula is =DATE(YEAR(F8),MONTH(F8)=I8,DAY(F8)). Cell O8 is the same as I8 so you could use that. Thanks for your help!
    – Patrick
    Feb 15, 2018 at 21:59
  • Is this the only row you have, or you will have several rows below this one each with possibly a different start date but all data to be evaluated against Jul thru Jun columns fixed for monthly amounts?
    – patkim
    Feb 15, 2018 at 22:13
  • Yes I will have multiple rows with different data but always being evaluated against Jul- Jun. The only time that it would extend beyond Jun would be if I prepay a contract say on Dec but for 1 year so it would cover 2 fiscal periods.
    – Patrick
    Feb 15, 2018 at 22:20
  • What if the start date is somewhere in the middle or towards end of the month say it starts on 7/29/2017. Now your end date would be 10/29/2017. Do you still want to consider full monthly billing for just 2 days in Jul-17 and leave 0 in Oct-17 or 3 months?
    – patkim
    Feb 15, 2018 at 23:12

1 Answer 1

1

Based on what I understand, I suggest a solution that requires you to create valid dates in the Month Row rather than putting Text MMM (Jan, Feb, Mar etc). It will be a lot more easier this way. You just need to format it as MMM-YY so that it will be shown as Jul-17, Aug-17 and so on. This will make it more convenient when the next year starts.

I am still not clear the purpose of hidden column O as seen in your formula. This solution does not require it though.

In this example F7 holds Start Date, G7 holds Amount I7 holds Number of Months and Monthly Amount is in J7. R7 onward is the monthly split.

In R7 put the following formula

=IF(AND(MONTH($F$7)=MONTH(R6),YEAR($F$7)=YEAR(R6)),$J$7,0) 

R7 is the starting point. There's nothing before it, hence it's a two formula solution.

Now in S7 put the following formula and drag it across horizontally till intended columns. Note that as mentioned earlier I assume that you have valid dates in format MMM-YY in Row 6 R6 onward for this to work.

=IF(R7=0,IF(AND(MONTH($F$7)=MONTH(S6),YEAR($F$7)=YEAR(S6)),$J$7,0),IF(COUNTIF($R$7:R7,"<>0")<$I$7,$J$7,0))

Now put your data in the input cells and test the solution. You can extend it to next year as well. Just create Valid MMM-YY data in row 6.

enter image description here

14
  • Pat2015 you're a genius! Thanks so much! If you were close I would buy you a drink :)
    – Patrick
    Feb 20, 2018 at 17:14
  • Pat2015. Hold up on the celebration. I did everything you recommended and everything seems to be working but I did just come across an issue. I put a start date of 1/1/2018 with a life of 0.5 for a half year and its only populating Jan's cell and not Feb and on. Suggestions?
    – Patrick
    Feb 21, 2018 at 0:24
  • The solution is based on only Integers in Months columns as per clarification in comments. Also Years column is not used. When you put 0.5 years, what value are you getting in Months?Assuming you have some formula therein to convert Years to Months in your sheet.
    – patkim
    Feb 21, 2018 at 4:56
  • Yes the it will always be an integer rule is valid for the months. When I type in 0.5 for years 6 is what populates in the Months cell because that Cell is = Yrs*12 so 0.5*12=6. Thanks for your help!
    – Patrick
    Feb 21, 2018 at 17:27
  • You may like to show what formula are you using in your sheet to populate month's columns.
    – patkim
    Feb 22, 2018 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .