# How to lookup the first non '0' number in a list?

I have 3 column, A = Date, unsorted; B = Value, unsorted: C = Balance, calculated.

I am trying to find the smallest number in column c when the sheet is sorted by Date, (A assending), and the date associated with it.

I can get it but the process is cumbersome. (see attached sample) … I was thinking I could write a macro to do the copying, sorting and selecting but … I have no idea if a macro would accomplish what I am trying to do.

Assistance would be appreciated.

Help 1.ods

EDIT: Notes do not pertain to question. Please disregard the notes and even the question for that matter.

Obtain date in column E for the first minimum value in column G, i.e. in the same row:

``````=OFFSET(E5;MATCH(MIN(G5:G23);G5:G23;0)-1;0)
``````

It would be more straight forward if you reordered columns and had the running balance in the first column of a data set so you could use VLOOKUP (here with Bal in E, Value in F and Date in G):

``=VLOOKUP(MIN(E5:E23);E5:G23;3;0)``

Fwiw, your description (“smallest number”) and sample data don’t match the summary/title of your question (“first non ‘0’ number”) because obviously MIN() will also find a `0` if that happens to be the smallest number.