Forum Discussion
R_J_P
Aug 23, 2023Copper Contributor
Help with formula for different length months in accounting worksheet
I'm having the days of the month autofill but I don't know how to have it stop for months that have fewer days e.x. 28,29,30,31. I need it to be able to divide the profit margin by the d...
Patrick2788
Aug 23, 2023Silver Contributor
It depends on how you're generating the 'dates'. If the 'dates' are simply whole numbers then it won't skip a date like 2/30, for example.
You could generate the dates with SEQUENCE. This formula would generate 60 dates beginning on 2/1/23 and skip non-existant dates like 2/31/23, for example.
=SEQUENCE(60,,DATE(2023,2,1))