While using fill for dates in Excel, there are 4 options.
Fill Days. Fill Weekdays. Fill Months. Fill Years.
I am trying to implement the basic functionalities of a Spreadsheet application. I have implemented the Fill Series for normal numeric values by employing least squares method by finding a line of best fit (https://superuser.com/questions/1334032/what-exactly-is-excels-auto-fill-algorithm).
If we generally fill dates, it's simple. Because each date value can be translated to some EPOCH value and based on those long integer values, the best fit line can be found and the values can be filled.
Example
1/1/1970 - 1
4/1/1970 - 4
So the values can be found as 7, 10, 13... and the corresponding date values can be generated.
How to employ the same method for Weekdays, Months and Years? Excel's fill for these 3 sets seems to be complex and very hard to comprehend and find a pattern.
Update:
The cells in grey are user entered initial values. I have filled the dates in each column for Weekdays. I am unable to arrive at any kind of pattern in filling dates for weekdays.