Link to home
Start Free TrialLog in
Avatar of James Murrell
James MurrellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel divide by months until year end

Hello and thanks in advance

i have a sales sheet which staff record date, customer and recurring amount...

what i need is another column which works out the recurring amount by month left until end year (which is in cell z1, 31st may 2016)

Please note I am not great at excel.....but willing to learn

example

date                         Customer       Recurring

15 June 2015           AS                          2300
17 June 2015           BE                         17000
2 July 2015               CF                        25000

need

date                         Customer       Recurring    New

15 June 2015           AS                          2300      12 month left so total ok
17 June 2015           BE                         17000     12 month left so total ok    
2 July 2015               CF                        25000      I think i need divide by 12 then multiply by 11
2 August 2015         GH                      125000     I think i need divide by 12 then multiply by 10

etc

hope you guys can help
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

I'm assuming this is what you are looking for...

Saurabh..
Data.xlsx
Avatar of Kanti Prasad
Kanti Prasad

Hi

Put the below formula in each cell of Recurring and see that every row has Z1 as your date is in Z1.

With the below formula, the Recurring column will have   2300, 17000, 20833.3, 93750


=IF((YEAR(Z1)-YEAR(A2))*12+MONTH(Z1)-MONTH(A2)<11,(C2/12*YEAR(Z1)-YEAR(A2))*12+MONTH(Z1)-MONTH(A2),C2)

=IF((YEAR(Z1)-YEAR(A3))*12+MONTH(Z1)-MONTH(A3)<11,(C3/12*YEAR(Z1)-YEAR(A3))*12+MONTH(Z1)-MONTH(A3),C3)

=IF((YEAR(Z3)-YEAR(A4))*12+MONTH(Z3)-MONTH(A4)<=11,(C4/12*YEAR(Z3)-YEAR(A4))*12+MONTH(Z3)-MONTH(A4),C4)

=IF((YEAR(Z4)-YEAR(A5))*12+MONTH(Z4)-MONTH(A5)<=11,(C5/12*YEAR(Z4)-YEAR(A5))*12+MONTH(Z4)-MONTH(A5)C5)
Avatar of James Murrell

ASKER

Saurabh Singh Teotia that is great but if they enter 0 you calculation shows 1
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry not in date field in c3   i changed but still did not work sorry
Hi

Please use this updated xls . I just added the month difference column so that the formula will not look too big. This one will calculate values for less that a year or even if required for more than a year
UpdatedXls.xlsx
thanks you pointed me in right direction and i managed to understand you new code: i made a change in one part but this is correct solution

my change
=IF(OR(DATEDIF(A2,DATE(2016,5,31),"YM")+1=12,C2=0,C2=""),"",(C2/12)*DATEDIF(A2,DATE(2016,5,31),"YM")+1)