Excel Formula for First Instance of Something in Row, Then Top Value in That Column?
June 23, 2011 4:32 AM Subscribe
Excel question (debt management/budgeting): what formula gets me the first instance of something in a row, and then how I can pull the date from the top of that column? More inside.
I'm looking to write a formula that returns the first instance in which a range of cells add up to zero. Each column is a paycheck, and if those range of cells add up to zero, it means I'm debt-free. The top cell of said column would be the date that I would become debt-free.
My goal is to basically have the spreadsheet present to me in a prominent place that date -- this way, if any budget adjustments make it go further out, it'll give me pause.
So ... is there a formula that will return the cell value of the first instance of something in a row -- and, then, is there a way to go from there to get the value of the top cell in that cell's column?
Thanks, everyone!
posted by WCityMike to computers & internet (8 answers total)
From here out, I'm going to write a solution assuming your data is in cells A2:F10, and that your dates are in A11:F11. You'll need to adjust accordingly.
2) Enter the following formula in each cell (A1, B1, C1...) of the new row:
=MAX(A2:A10)
3) Set the formula of any cell (outside A1:F11) to:
=HLOOKUP(0,A1:F11,11,FALSE)
That last formula is "horizontal lookup" -- it means, "look for the first 0 you can find in the top row of A1:F11, then return the value that's in the 11th row of that column."
posted by foursentences at 5:13 AM on June 23, 2011