Investors & landlords

When I depreciate hardwood floors and carpet in 2018, I am only allowed a small portion. Can I offset the gains I made by selling with the remaining cost from 2018?