简体   繁体   中英

Sum current and prior year month-to-date to corresponding day of month

In the picture, I have a running monthly total at the bottom for THIS YEAR. I have Last Year already populated. How can I have LY monthly total only populate to where I am currently today?

SO25556816问题示例

Generalising (for lack of a clear requirements statement - but conveniently then possibly of wider relevance) if you have two columns of numeric values with one (say A) of 31 entries and a column label (in Row1) and the other (say B) of 15 entries and column label and you want to add both down only as far as the shorter column is populated then you might:

In B32 enter =SUM(B2:B31) - to derive the "current month to date" total.
In A32 enter =SUM(INDIRECT("A1:A"&MATCH(1E+100,B1:B31,1))) - to derive the sum of the same rows (but different column) as above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM