Spreadsheet: 782279d1653941387-how-to-find-the-last-non-zero-value-in-a-row-cash-flow-example
Sheet: Sheet1

 | Period |  |  |  |  |  |  |  |  |  |  |  |  | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80
 | Date |  |  |  |  |  |  |  |  |  |  |  |  | 2023-03-31 00:00:00 | 2023-06-30 00:00:00 | 2023-09-30 00:00:00 | 2023-12-31 00:00:00 | 2024-03-31 00:00:00 | 2024-06-30 00:00:00 | 2024-09-30 00:00:00 | 2024-12-31 00:00:00 | 2025-03-31 00:00:00 | 2025-06-30 00:00:00 | 2025-09-30 00:00:00 | 2025-12-31 00:00:00 | 2026-03-31 00:00:00 | 2026-06-30 00:00:00 | 2026-09-30 00:00:00 | 2026-12-31 00:00:00 | 2027-03-31 00:00:00 | 2027-06-30 00:00:00 | 2027-09-30 00:00:00 | 2027-12-31 00:00:00 | 2028-03-31 00:00:00 | 2028-06-30 00:00:00 | 2028-09-30 00:00:00 | 2028-12-31 00:00:00 | 2029-03-31 00:00:00 | 2029-06-30 00:00:00 | 2029-09-30 00:00:00 | 2029-12-31 00:00:00 | 2030-03-31 00:00:00 | 2030-06-30 00:00:00 | 2030-09-30 00:00:00 | 2030-12-31 00:00:00 | 2031-03-31 00:00:00 | 2031-06-30 00:00:00 | 2031-09-30 00:00:00 | 2031-12-31 00:00:00 | 2032-03-31 00:00:00 | 2032-06-30 00:00:00 | 2032-09-30 00:00:00 | 2032-12-31 00:00:00 | 2033-03-31 00:00:00 | 2033-06-30 00:00:00 | 2033-09-30 00:00:00 | 2033-12-31 00:00:00 | 2034-03-31 00:00:00 | 2034-06-30 00:00:00 | 2034-09-30 00:00:00 | 2034-12-31 00:00:00 | 2035-03-31 00:00:00 | 2035-06-30 00:00:00 | 2035-09-30 00:00:00 | 2035-12-31 00:00:00 | 2036-03-31 00:00:00 | 2036-06-30 00:00:00 | 2036-09-30 00:00:00 | 2036-12-31 00:00:00 | 2037-03-31 00:00:00 | 2037-06-30 00:00:00 | 2037-09-30 00:00:00 | 2037-12-31 00:00:00 | 2038-03-31 00:00:00 | 2038-06-30 00:00:00 | 2038-09-30 00:00:00 | 2038-12-31 00:00:00 | 2039-03-31 00:00:00 | 2039-06-30 00:00:00 | 2039-09-30 00:00:00 | 2039-12-31 00:00:00 | 2040-03-31 00:00:00 | 2040-06-30 00:00:00 | 2040-09-30 00:00:00 | 2040-12-31 00:00:00 | 2041-03-31 00:00:00 | 2041-06-30 00:00:00 | 2041-09-30 00:00:00 | 2041-12-31 00:00:00 | 2042-03-31 00:00:00 | 2042-06-30 00:00:00 | 2042-09-30 00:00:00 | 2042-12-31 00:00:00 | 2043-03-31 00:00:00
 |  |  |  |  |  | Final Date | Total
 | Total Outflows |  |  |  |  |  |  |  |  |  |  |  |  | -1e-08 | -3.773072475270139 | -4.445765865711404 | -5.157178627666137 | -5.889682859771508 | -6.621948436322126 | -7.329828747350961 | -7.987594513997711 | -8.569437995791521 | -9.051130367261575 | -9.411686411567104 | -9.634878122893117 | -9.710445408583245 | -9.634878122893117 | -9.411686411567104 | -9.051130367261575 | -8.569437995791521 | -7.987594513997711 | -7.329828747350961 | -6.621948436322126 | -5.889682859771508 | -5.157178627666137 | -4.445765865711404 | -3.773072485270139 | -3.152520061045109 | -2.593192267227375 | -2.100031096279769 | -1.674290766079559 | -1.314165879724279 | -1.015508682901005 | -0.7725582661420526 | -0.5786194058821141 | -0.4266471953706434 | -0.3097126497612698 | -0.2213416491036895 | -0.1557333003970207 | -0.1078733044287422 | -0.07356320225552154 | -0.0493879976120238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 | Total Inflows |  |  |  |  |  |  |  |  |  |  |  |  | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3.474528889393527 | 3.823483902817605 | 4.191081848873558 | 4.576111057898188 | 4.977032841102449 | 5.391976543872753 | 5.81874090172429 | 6.254802216960202 | 6.69732972487063 | 7.143208344746167 | 7.589068817415628 | 8.031325022931732 | 8.466218055896613 | 8.88986641899917 | 9.29832148539706 | 9.687627185591907 | 10.05388270225672 | 10.39330681443477 | 10.7023024271624 | 10.9775197592416 | 11.21591664452696 | 11.41481443295377 | 11.57194805705015 | 11.685508956374 | 11.75417972283284 | 11.77715953902566 | 11.75417972283284 | 11.685508956374 | 11.57194805705015 | 11.41481443295377 | 11.21591664452696 | 10.9775197592416 | 10.7023024271624 | 10.39330681443477 | 10.05388270225672 | 9.687627185591907 | 9.29832148539706 | 8.88986641899917 | 8.466218055896613 | 8.031325022931732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
 | Total Cash Flows