Judging by the over 10 year old Macs I have still running every day then a long time. I sold my 2018 6 core i7 for a little over half what I paid for it, but that was enough to buy a new M1 Mac Mini with 512 SSD. I sold a 2012 Upgraded Mac Pro that brought a little over the price I paid for the Video card, oh well. Any computer just about will suffice for what I do. I keep some Minis because I am running a legacy software on them, they upgraded the software I am using but it is sort of like AppleWorks 6 that everyone called a downgrade, which it was.
I have the M1 Mini off line most of the time, only have it to keep up with new developments. I can tell when the 2012 Minis are running even at idle they put off significant heat, the M1, I have to actually check to see if it is running because it feels the same running or not. I also purchased three MacBook air models for Wife, Kid and Grand kid. Mostly by selling off some of my intel Macs at a painful discount price.
I recently bought a M1 Mac Mini with 512 SSD, I have it stacked on top of a 2010 Mini and 2012 Mini. Wife got Turbo Tax and it wouldn't run on my 2017 MacBook Pro, because I am not upgrading to latest O/S because it'll clobber my older apps licensing. Very impressed with the M1 Mini, runs everything no problem, and fast. I keep the older models, each having it's share of older apps and uses. My 2010 Mini is dedicated to 3D printing, the printer ties up the machine for hours at a time. I still use my 2010 and 2011 iPads. No need to toss out perfectly functioning old Macs if you have a need for them, although you should get newer ones after a few years for the newer features. I keep them all networked to share files. (As for cost, selling Apple shares pays for it all.)