Forum Discussion

Melvyn1's avatar
Melvyn1
Copper Contributor
Feb 10, 2024

Middle of the sum of a list of numbers

Hello,    I have lists of numbers organized this way : 7 14 19 35 41 10 20 16 10 13 7 5 1 2 I need to find at which cell the sum of relative frequencies pass 50%. In this case it wou...
  • m_tarler's avatar
    Feb 10, 2024

    Melvyn1 Here is one option.  it doesn't use lambda but does use some newer functions that require excel 2019 I think.  But it could also be modified to use some older context if needed:

     

    =LET(in,A1:A14,XLOOKUP(SUM(in)/2,MMULT(--(SEQUENCE(ROWS(in))>=SEQUENCE(,ROWS(in))),in),in,,1))

     

     if you don't have a newer version of excel you can use something like this:

    =INDEX(A1:A14,MATCH(SUM(A1:A14)/2-0.1,MMULT(--(ROW(A1:A14)>=TRANSPOSE(ROW(A1:A14))),A1:A14),1)+1)

    you might need to use ctrl,shift, enter when you enter the formula.  it does assume you are using whole number and therefore the -0.1 is enough to make sure it is never exactly = to 1/2 but you could use a sufficiently small offset if needed.

Resources