Looking Up the First Nonzero Value in a Column

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
 
P

Peo Sjoblom

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
 
T

TKrepitch

(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top