Today I am asking you a tricky formula question. This is asked by Ionel on the Introduction to VLOOKUP, OFFSET & MATCH Formulas post.
The question is,
I have data in three columns: A,B,C and I want to get the average of the closest two values out of three in each row. Could you help me with a formula for this?
Now, how would you go about it?
What does closest of two mean?
We can assume that close-ness is nothing but distance between 2 numbers on numeric scale. So 3 is closer to 2 and 4 compared to 1 or 5.
Your challenge:
Assuming your data is in A2:C10, what formula will you write in D2:D10 to solve this?
Go ahead and get some coffee and get thinking.
Want to cop-out?
I have posted one solution in the next comment. You can see how I went about solving it.














2 Responses to “Celebrating the Lookup Formulas – VLOOKUP Week @ Chandoo.org”
How did you arrive or formula when you ask me who made more sales Jackie or Jamie?? I could not figure the formula out yet??
@Frank
You need to sum up the sales for Jackie and compare them to the sales of Jamie over the same period.
The practical parts depends on how and what data you have and how it is arranged.
But it will either involve a Sum, Sumif, Sumifs or Sumproduct to accummulate the sales for each within a specified date range.