Forum Discussion

David-A-S's avatar
David-A-S
Copper Contributor
Mar 12, 2023
Solved

Filter based on minimum value C for each value A

I'm trying to find a way to filter by a value, and then filter and keep only the lowest value.

So the order would look like this:

It first filters the middle column by the input, but then I'm struggling to keep only the small right column value for each left column value. If it simplifies anything, my end goal is to sum the resulting right column together.

 

  • David-A-S 

     

    Assuming your chosen input is in A1 and data in C1:E9

     

    =LET(
        ξ, A1,
        ζ, C1:E9,
        ε, LAMBDA(α, β, INDEX(α, , β)),
        γ, ε(ζ, 2),
        δ, FILTER(ζ, γ = ξ),
        κ, ε(δ, 1),
        λ, ε(δ, 3),
        FILTER(δ, λ = BYROW(κ, LAMBDA(μ, MIN(IF(κ = μ, λ)))))
    )

     

     

     

     

  • JosWoolley's avatar
    JosWoolley
    Iron Contributor

    David-A-S 

     

    Assuming your chosen input is in A1 and data in C1:E9

     

    =LET(
        ξ, A1,
        ζ, C1:E9,
        ε, LAMBDA(α, β, INDEX(α, , β)),
        γ, ε(ζ, 2),
        δ, FILTER(ζ, γ = ξ),
        κ, ε(δ, 1),
        λ, ε(δ, 3),
        FILTER(δ, λ = BYROW(κ, LAMBDA(μ, MIN(IF(κ = μ, λ)))))
    )

     

     

     

     

Resources