Hi everyone,
i am struct in tricky part of If condition in excel spreadsheet, actually i am calculating the depreciation for my vehicles and partially succeeded but beginning year calculation is not showing correct results as i want the purchas year's cut of date should be on 31 December of same year, i have put the formula to calculate the days for first year, so it should be based on that days for 1st Year of calculation and the rest will be continue as normal calculation based on method i have selected in criteria of other cell.
I have methods sheet that calculate the depreciation based on selected method on result area, for more clarification i have mentioned the spreadsheet view for your reference.
The problem is in 1st year of calculation that need to be restrict to same year end and from next year it will be full, based on how many years i have selected in calculation for depreciation.
B6[TABLE="width: 2482"]
<tbody>[TR]
[TD="class: xl70, width: 71"]Buy Date[/TD]
[TD="class: xl72, width: 70"]F6 Price[/TD]
[TD="class: xl72, width: 45"]G6 Year[/TD]
[TD="class: xl72, width: 67"]H6 Salvage[/TD]
[TD="class: xl72, width: 39"]I6 Life[/TD]
[TD="class: xl72, width: 66"] J6 Method [/TD]
[TD="class: xl74, width: 70"]K6 Buying Year/Days[/TD]
[TD="class: xl73, width: 16"][/TD]
[TD="class: xl72, width: 49"]2000[/TD]
[TD="class: xl72, width: 49"]2001[/TD]
[TD="class: xl72, width: 49"]2002[/TD]
[TD="class: xl72, width: 49"]2003[/TD]
[TD="class: xl72, width: 49"]2004[/TD]
[TD="class: xl72, width: 49"]2005[/TD]
[TD="class: xl72, width: 49"]2006[/TD]
[TD="class: xl72, width: 49"]2007[/TD]
[TD="class: xl72, width: 49"]2008[/TD]
[TD="class: xl72, width: 49"]2009[/TD]
[TD="class: xl72, width: 49"]2010[/TD]
[TD="class: xl72, width: 49"]2011[/TD]
[TD="class: xl72, width: 49"]2012[/TD]
[TD="class: xl72, width: 73"]2013[/TD]
[TD="class: xl72, width: 73"]2014[/TD]
[TD="class: xl72, width: 66"]2015[/TD]
[TD="class: xl72, width: 66"]2016[/TD]
[TD="class: xl72, width: 73"]2017[/TD]
[TD="class: xl72, width: 66"]2018[/TD]
[TD="class: xl72, width: 66"]2019[/TD]
[TD="class: xl72, width: 66"]2020[/TD]
[TD="class: xl72, width: 66"]2021[/TD]
[TD="class: xl72, width: 66"]2022[/TD]
[TD="class: xl72, width: 66"]2023[/TD]
[TD="class: xl72, width: 66"]2024[/TD]
[TD="class: xl72, width: 66"]2025[/TD]
[TD="class: xl72, width: 66"]2026[/TD]
[TD="class: xl72, width: 66"]2027[/TD]
[TD="class: xl72, width: 66"]2028[/TD]
[TD="class: xl72, width: 66"]2029[/TD]
[/TR]
</tbody>[/TABLE]
Present formula is
=IF(AND(M$6>=$G7,M$6<=$I7+$G7-1),IF(ISERROR(MATCH($J7,methods,0)),"n/a",IF($J7="SL",SLN($F7,$H7,$I7),IF($J7="SYOD",SYD($F7,$H7,$I7,M$6-$G7+1),VDB($F7,$H7,$I7,M$6-$G7,M$6-$G7+1,INDEX(factors,MATCH($J7,methods,0)),INDEX(noswitch,MATCH($J7,methods,0))))))," - ")
So, i need to add the Buying Year/days to restrict it for current year of purchase and then leave it in serial for remaining years based on calculation method and salvage value i have selected.
i am struct in tricky part of If condition in excel spreadsheet, actually i am calculating the depreciation for my vehicles and partially succeeded but beginning year calculation is not showing correct results as i want the purchas year's cut of date should be on 31 December of same year, i have put the formula to calculate the days for first year, so it should be based on that days for 1st Year of calculation and the rest will be continue as normal calculation based on method i have selected in criteria of other cell.
I have methods sheet that calculate the depreciation based on selected method on result area, for more clarification i have mentioned the spreadsheet view for your reference.
The problem is in 1st year of calculation that need to be restrict to same year end and from next year it will be full, based on how many years i have selected in calculation for depreciation.
B6[TABLE="width: 2482"]
<tbody>[TR]
[TD="class: xl70, width: 71"]Buy Date[/TD]
[TD="class: xl72, width: 70"]F6 Price[/TD]
[TD="class: xl72, width: 45"]G6 Year[/TD]
[TD="class: xl72, width: 67"]H6 Salvage[/TD]
[TD="class: xl72, width: 39"]I6 Life[/TD]
[TD="class: xl72, width: 66"] J6 Method [/TD]
[TD="class: xl74, width: 70"]K6 Buying Year/Days[/TD]
[TD="class: xl73, width: 16"][/TD]
[TD="class: xl72, width: 49"]2000[/TD]
[TD="class: xl72, width: 49"]2001[/TD]
[TD="class: xl72, width: 49"]2002[/TD]
[TD="class: xl72, width: 49"]2003[/TD]
[TD="class: xl72, width: 49"]2004[/TD]
[TD="class: xl72, width: 49"]2005[/TD]
[TD="class: xl72, width: 49"]2006[/TD]
[TD="class: xl72, width: 49"]2007[/TD]
[TD="class: xl72, width: 49"]2008[/TD]
[TD="class: xl72, width: 49"]2009[/TD]
[TD="class: xl72, width: 49"]2010[/TD]
[TD="class: xl72, width: 49"]2011[/TD]
[TD="class: xl72, width: 49"]2012[/TD]
[TD="class: xl72, width: 73"]2013[/TD]
[TD="class: xl72, width: 73"]2014[/TD]
[TD="class: xl72, width: 66"]2015[/TD]
[TD="class: xl72, width: 66"]2016[/TD]
[TD="class: xl72, width: 73"]2017[/TD]
[TD="class: xl72, width: 66"]2018[/TD]
[TD="class: xl72, width: 66"]2019[/TD]
[TD="class: xl72, width: 66"]2020[/TD]
[TD="class: xl72, width: 66"]2021[/TD]
[TD="class: xl72, width: 66"]2022[/TD]
[TD="class: xl72, width: 66"]2023[/TD]
[TD="class: xl72, width: 66"]2024[/TD]
[TD="class: xl72, width: 66"]2025[/TD]
[TD="class: xl72, width: 66"]2026[/TD]
[TD="class: xl72, width: 66"]2027[/TD]
[TD="class: xl72, width: 66"]2028[/TD]
[TD="class: xl72, width: 66"]2029[/TD]
[/TR]
</tbody>[/TABLE]
Present formula is
=IF(AND(M$6>=$G7,M$6<=$I7+$G7-1),IF(ISERROR(MATCH($J7,methods,0)),"n/a",IF($J7="SL",SLN($F7,$H7,$I7),IF($J7="SYOD",SYD($F7,$H7,$I7,M$6-$G7+1),VDB($F7,$H7,$I7,M$6-$G7,M$6-$G7+1,INDEX(factors,MATCH($J7,methods,0)),INDEX(noswitch,MATCH($J7,methods,0))))))," - ")
So, i need to add the Buying Year/days to restrict it for current year of purchase and then leave it in serial for remaining years based on calculation method and salvage value i have selected.