• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Ask about excel function

saraessam

New Member
Ask about function in excel to find the 2 closest numbers in 2 different columns condition have a common value in a third column
for example:
there's 3 columns of data code , price , taxes and given target price and target taxes i want to find the closest for each one but have condition they both have the same code
 
Please post a sample sheet ( no pics) with some data and manually evaluated results. thx
I am not sure the question meant much to me. I have attempted a 365 solution to the problem as I understood it.
84200
Code:
ClosestValueλ
= LAMBDA(price, target, code, LAMBDA(c,
    LET(
        filtered, FILTER(value, code = c),
        variance, ABS(filtered - target),
        XLOOKUP(TRUE, variance = MIN(variance), filtered)
    )
 ))
Even if the proposed solution does not suit the OP it may serve to help define the problem.
 

Attachments

  • ClosestValues.xlsx
    19.6 KB · Views: 3
Back
Top