Forum Discussion

mtlbooks's avatar
mtlbooks
Copper Contributor
Dec 18, 2022

how do i make exel split an amount throghout a few celles

I take the train every day for a round trip, and I buy every few days a multiple-trip ticket I went. Excel should split the amount I paid for the ticket by the number of trips the ticket has and calculate two trips a day.   I hope this was clear enough!

 

 

3 Replies

    • mtlbooks's avatar
      mtlbooks
      Copper Contributor
      Thanks! it seems I was not that clear, when I will enter your formula it filles in just cell c1, but I want it to fill atoumaticley every day until the tripes are used up. In this case it will be c2:c4.
      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        mtlbooks 

        Is this closer?

        It is not so simple though,

        = IFNA(DROP(
             REDUCE("", SEQUENCE(ROWS(paid)),
                 LAMBDA(list, k,
                    LET(
                       t, INDEX(trips, k) / 2,
                       p, INDEX(paid, k),
                       r, IF(t > 0, IF(SEQUENCE(t), p / t)),
                       VSTACK(list, HSTACK(k, r))
                    )
                 )
             ),
          1),"")