Home > Software engineering >  find the first cell in range where cumulative sum >= 0
find the first cell in range where cumulative sum >= 0

Time:07-13

I have an excel file like this: enter image description here

could anyone help me to find the first cell (from left to right) so that cumulative sum >=0

enter image description here

Formula in C6:

=XLOOKUP(TRUE,SCAN(0,C2:J2,LAMBDA(a,b,a b))>=0,C2:J2,"No value >= 0")

CodePudding user response:

Or prior Excel versions:

=INDEX(C1:J1,MATCH(TRUE,(MMULT(--(COLUMN(C1:J1)<=TRANSPOSE(COLUMN(C1:J1))),TRANSPOSE(C1:J1)))>=0,0))

(May require entered with ctrl shift enter)

  • Related