Looking Up the First Nonzero Value in a Column

  • Thread starter Thread starter TKrepitch
  • Start date Start date
T

TKrepitch

Hello everyone,

I am looking for a function that can return the first nonzero value in
a column. I have a table that has months across the top and down the
leftmost column. The data in the table are balances as of each month,
essentially.

It looks like this:

J F M A M
J 1
F 2 1
M 3 2 1
A 4 3 2 1
M 5 4 3 2 1

Is there a way to say, "Look in the column labeled "F" and return the
first nonzero number"? Then the cell below it will need to be the
number directly below that first number, and so on. I'd appreciate
any help. Thanks!

Sincerely,
Tom
 
Maybe something like this

=INDEX($F$2:$F$200,MATCH(TRUE,$F$2:$F$200<>0,0)+ROW(1:1)-1)

copied down, if no negative numbers are possible

=INDEX($F$2:$F$200,MATCH(TRUE,$F$2:$F$200>0,0)+ROW(1:1)-1)

has to be entered with ctrl + shift & enter
 
(e-mail address removed) (TKrepitch) wrote in message
Could you please help me adjust this formula to do the same thing, but
with rows instead of columns? I'm pretty close, but still missing
something.

I want to find the first nonzero value in a row of numbers using a
similar equation, then be able to copy it across and down. Thanks!

Sincerely,
Tom
 
Back
Top