Monthly stem serial number: (year mantissa -3)x2+ lunar month, and the result is divided by 10 to get the remainder.
The monthly branch is fixed, the first month of the lunar calendar is cloudy, and so on.
The sun column is the most difficult. There are big and small months mixed with peaceful leap years. I made an excel menu directly and converted the "high solar column formula" into a function. I can give it to you if necessary. Form lovers can also come to me. Oh, contact me again!