Forum Discussion
JohnG1948
Sep 09, 2023Copper Contributor
Retuning the value of a cell based on another cell found to have a given value
Hi Everyone
This is my 1st post so forgive me if I'm not perfectly clear. I spent many years programming in many languages from assembler to C++ but this my 1st foray into Excel. It's turning out to be a bit of a culture shock.
I have a sheet with dates in column "A" and values in Column "C". I want to search column "A" for a date that is "<=" a given date (that part seems easy enough). Now I want to return the value in the corresponding row in column "c".
Phrased differently: if a date <= given date found A10 return value in C10.
Thanks in advance
John
Will the dates in column A be sorted in ascending order?
Do you want to return the value of the first date <= given date that is found in column A, going from top to bottom,or the last date <= given date, or ...?
- JohnG1948Copper ContributorThe dates will be in ascending order.
I do not want to return the date. I want to return the value in another column "A" has dates "C" has values I needYes, I understood that, but you didn't answer my question.
Does this do what you want?
The formula in G2 is
=XLOOKUP(F2,A2:A10,C2:C10,"",-1)