Need help with finding the date difference in months between 2 different cells if the day is less than 15

cdelappe

New Member
Joined
May 17, 2013
Messages
2
Hi-

Need some help.

I am trying to design a depreciation register and am having problems with the datedif() formula. Wondering is someone Know of a way to calculate between dates if the day in the purchase date is less than or equal to 15, then start counting from purchase date month. If it is not than start calculating from the month after the purchase date?


Formula is as follows...
06/30/2012 07/01/2011

ABCDEFGHIJK
106/30/201207/01/2011
2Tag NoPurchase Dateuseful life in yrsest end datemonths in usepurch
cost
prior yrs accumcurrent yrs depannual net bookmonthly deptotal
deprec
3ps-057205/21/2012405/20/2016 12547.88 -636.972494.8053.8053.80
4ps-057205/21/201242547.88 $0.0053.082494.8053.8053.80

<tbody>
</tbody>

The Third Row is what my calculations are coming up with, 4th Row is what they should be.

Formulas:

Column D:
  • =IF(C3<=0," ",B3+(C3*365))
Column E:
  • =IF(D3<=$A$1,"",ROUND(DATEDIF(B3,$A$1,"m"),0))
Column F:
  • Is a Fixed column
Column G:
  • =IF(E3<12,0,IF(AND(D3<$A$1,H3=0),F3,(K3-H3)))
Column H:
  • =IF(AND(B3<$A$1,B3>$B$2),ROUND(DATEDIF(B3,$A$1,"YM")-DATEDID($B$1,B3,"YM"),0)*J3,IF(D3<$A$1,0,F3/C3))
​Column I:

  • =F3-K3
Column J:
  • =IFERROR(F3/C3/12," ")
Column K:
  • =IF(D3<$A$1,F3,ROUND(DATEDIF(B3,$A$1,"M"),0)*J3)


Thank you in Advance for your assistance in this problem.
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
cdelappe,

Welcome to MrExcel.

Perhaps this will help?

Either use a 'helper' columnl (New column c) and make appropriate references to C in your formulas, rather than the current B references.

OR incorporate the formula C3 directly, in your other formulas. Eg as in E4.
Excel 2007


Excel 2007
BCDE
2Purchase Dateuseful life in yrsest end date
315/05/201215/05/2012414/05/2016
415/05/2012414/05/2016
Sheet2




BCDE
2Purchase Dateuseful life in yrsest end date
321/05/201221/06/2012420/06/2016
421/05/2012420/06/2016

<COLGROUP><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet2

Worksheet Formulas
CellFormula
C3=IF(DAY(B3)<16,B3,DATEVALUE(DAY(B3)&"-"&MONTH(B3)+1&"-"&YEAR(B3)))
E3=IF(D3<=0," ",C3+(D3*365))
E4=IF(D4<=0," ",IF(DAY(B4)<16,B4,DATEVALUE(DAY(B4)&"-"&MONTH(B4)+1&"-"&YEAR(B4)))+(D4*365))

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>



Hope that helps.
 
Last edited:
Upvote 0
cdelappe,

Welcome to MrExcel.

Perhaps this will help?

Either use a 'helper' columnl (New column c) and make appropriate references to C in your formulas, rather than the current B references.

OR incorporate the formula C3 directly, in your other formulas. Eg as in E4.
Excel 2007

Excel 2007
BCDE
2Purchase Dateuseful life in yrsest end date
315/05/201215/05/2012414/05/2016
415/05/2012414/05/2016

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2





BCDE
2Purchase Dateuseful life in yrsest end date
321/05/201221/06/2012420/06/2016
421/05/2012420/06/2016

<tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
C3=IF(DAY(B3)<16,B3,DATEVALUE(DAY(B3)&"-"&MONTH(B3)+1&"-"&YEAR(B3)))
E3=IF(D3<=0," ",C3+(D3*365))
E4=IF(D4<=0," ",IF(DAY(B4)<16,B4,DATEVALUE(DAY(B4)&"-"&MONTH(B4)+1&"-"&YEAR(B4)))+(D4*365))

<tbody>
</tbody>

<tbody>
</tbody>



Hope that helps.

I will definitely try it Thank you! I will let you know.
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,495
Members
449,088
Latest member
Melvetica

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