• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

Spreadsheet help please

Icosahedron

SOC-14 1K
Can someone assist my Excel-fu?

I want to return a value equal to the last value in a range. Is there a function or set of functions that will do this?

eg I have a list of values in column H. However, the spreadsheet is a working document, so I don't know how many entries column H will contain at any given time, but I want to enter the last nonzero value from column H into cell C1.

I can get the thing to show me the highest or lowest value, but not the last value. :(

Cheers.
 
=INDEX(H1:H9999,(SUM(COUNT(H1:H9999)+1)))

The "+1" at the end assumes you shifted the first value of column H down one row. Delete or change this value to match your need.

Example:
 

Attachments

  • Excel Solution.jpg
    Excel Solution.jpg
    21.2 KB · Views: 9
If there is guaranteed that there will be no blank cells in the range, use

Code:
=INDIRECT("H"&COUNTA(H:H))
If there may be blank cells in the range, use

Code:
=INDIRECT("H"&MAX(ROW(1:65535)*(B1:65535<>"")))
 
Back
Top